You provide the Microsoft OneDrive plugin with a code that you receive from Microsoft 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.
Go into the Add-on Settings for the plugin. Select the dmdsoftware OAUTH2 under Login Type. Enter a username. You can enter your Microsoft OneDrive 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
Authorize the KODI OneDrive plugin. You will be presented with a "code". This is the OAUTH2 code. Keep a copy of this code for the following step. The code is in the URL starting after the first = and before the &, as highlighted below.
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