You provide the Google Drive plugin with a code that you receive from Google when you authenticate my plugin to access your account. This is a one-time use code that you provide the XBMC / KODI plugin, which is passed through dmdsoftware.net where the server appends my client ID and client secret, and the responding authorization and refresh tokens is sent back to the XBMC / KODI plugin, where it is stored. At no time is the code, refresh or authorization tokens saved on dmdsoftware.net. The one-time code immediately expires when it is used to redeem an authorization token.
When the authorization token expired (after 60 mins), a refresh token is passed by XBMC / KODI plugin is passed through dmdsoftware.net where the server appends my client ID and client secret, and the responding authorization token is sent back to the XBMC / KODI plugin, where it is stored. At no time is the refresh or authorization tokens saved on dmdsoftware.net.
You can revoke any authorization and refresh tokens by visiting https://security.google.com/settings/security/permissions
Go into the Add-on Settings for the plugin. Select the dmdsoftware OAUTH2 under Login Type. Enter a username. You can enter your Google Drive username, but this value is not used other than to remind you what account is authenticated. Leave the OAUTH2 code empty. Click OK.
Open in a web browser the following URL https://accounts.google.com/o/oauth2/auth?scope=https://www.googleapis.com/auth/drive.readonly&redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=code&client_id=772521706521-bi11ru1d9h40h1lipvbmp3oddtcgro14.apps.googleusercontent.com. Authorize the KODI GDrive plugin. You will be presented with a "code". This is the OAUTH2 code. Keep a copy of this code for the following step.
Best option for systems without a keyboard. Create a .STRM file that contains the following entry. Then load this .STRM file in XBMC-> Videos -> Files. This will register the account and code without having to manually entering them.
containing the following inside enroll.strm