# ddurdle's XBMC / KODI Cloud Service Plugins

Some comments about the dmdsoftware.net pass-through:

- One-time use code.

  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.

- Renewing authorization

  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.

- Revoking authorization

  You can revoke any authorization and refresh tokens by visiting https://security.google.com/settings/security/permissions

## Getting Started

1. Setup an account in the plugin.

   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.

2. Authorize for READ-ONLY Google Drive access.

   Open in a web browser the following URL https://accounts.google.com/o/oauth2/auth?approval_prompt=force&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.

3. Add OAUTH2 code to the XBMC / KODI plugin using any ONE of the following options.
   - Type the code into the OAUTH2 code field in the Add-on Settings.
   - Edit the settings.xml file in the operating system file ~/.xbmc/userdata/addon_data/plugin.video.gdrive/settings.xml. Locate the field <setting id="gdrive#_code" value="" /> where # represents the # corresponding to the account # you entered in the prior step when you set the username. Enter the code inside the quotes for value="".
   - [best option] Create a .STRM file to create your username + code all in a single 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.
     filename: enroll.strm
     containing the following inside enroll.strm
     plugin://plugin.video.gdrive-testing/?mode=enroll&username=myusername@gmail.com&code=MyCodeThatIReceivedFromGoogle

   ### To support the continued development of this any ddurdle's other XBMC / KODI plugins, please considering donating using Paypal at the following URL http://goo.gl/j7v7SD