Skip to main content
Unlisted page
This page is unlisted. Search engines will not index it, and only users having a direct link can access it.
Version: Developer

Set up the OneDrive storage provider

The OneDrive storage provider lets end users map their OneDrive storage into container-based sessions. Access is provided through the Microsoft OAuth interface and the Rclone Docker volume plugin. For reference, see the Rclone OneDrive documentation and the Microsoft app registration quickstart.

Create a Microsoft OAuth app

  1. Log in to the Microsoft Azure Portal.
  2. Select Azure Active Directory.

Azure Active Directory control panel

Azure AD Control Panel
  1. Select App Registrations.

Azure app registrations

App Registrations
  1. Select New Registration.
  2. Give the app a name, such as Kasm OneDrive Example.
  3. In Supported account types, select Accounts in any organizational directory (Any Azure AD directory - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox).
  4. In the redirect URI, select Web, then enter the redirect URL, substituting the hostname of the Kasm deployment: https://kasm.example.com/api/cloud_storage_callback.
caution

This example creates an integration where any Microsoft user can authenticate with the Kasm app, which is ideal for a public-facing deployment. Other options are available for single-tenant and multi-tenant configurations.

Register the Microsoft app

Register an App
  1. On the next page, the Application (client) ID is shown. Save this value as the Client ID for the next section.
  2. Select Add a certificate or secret next to Client credentials.

Client credentials for the Microsoft app

Client Credentials
  1. Select the Client secrets tab, then click New client secret.
  2. Enter a description and expiration, then click Add.
  3. The credentials are shown. Save the Value as the Client Secret for the next section.

Client secret for the Microsoft app

Client Secret
  1. From the Manage menu on the left, select API Permissions.
  2. Select Add a Permission.

API permissions for the Microsoft app

API Permissions
  1. In the new window, select Microsoft Graph, then Delegated permissions.

  2. Add all of the following permissions:

    Files.Read
    Files.Read.All
    Files.ReadWrite
    Files.ReadWrite.All
    offline_access
    Sites.Read.All
    User.Read

Add Microsoft Graph permissions

Add Permissions
  1. Select the Overview section of the Azure app, then select Endpoints. Note the OAuth 2.0 authorization endpoint (v2) and OAuth 2.0 token endpoint (v2) values for the next section. These values differ depending on the app type created in the previous section, that is internal, public, or multi-tenant.

Azure app OAuth endpoints

Endpoints

Configure the storage provider

  1. Log in to the Kasm UI as an administrator.
  2. Select Settings, then Storage, then Add.
  3. Complete the form with the following entries, using the Client ID and Client Secret from the previous section:
FieldValue
NameOneDrive
Storage Provider TypeOneDrive
Enabledchecked
Client ID<client id>
Client Secret<client secret>
Authorization URL<OAuth 2.0 authorization endpoint (v2) value from the Microsoft OAuth app>
Authorization URL Options{"prompt" : "consent"}
Token URL<OAuth 2.0 token endpoint (v2) value from the Microsoft OAuth app>
Redirect URLhttps://<hostname>/api/cloud_storage_callback
ScopeFiles.Read Files.ReadWrite Files.Read.All Files.ReadWrite.All Sites.Read.All offline_access openid email profile
Root Drive URLhttps://graph.microsoft.com/v1.0/me/drive/root
Default Target/onedrive
Volume Config{ "driver" : "rclone", "driver_opts" : { "type" : "onedrive", "uid" : "1000", "gid" : "1000", "allow_other" : "true" } }
Mount Config{}
  1. Click Save.

OneDrive storage mapping configuration

  1. From any page, select the profile icon at the top right.

Edit the user profile

Edit Profile
  1. Select the Cloud Storage section, then Add Storage Mapping.

Add a storage mapping from the profile

Add Storage Mapping
  1. Select OneDrive from the drop-down, then select Next.

Configure the OneDrive storage mapping

Configure Storage
  1. The Microsoft login page appears. Log in with the desired account.

Log in to Microsoft

Login
  1. A consent screen appears that requests the permissions needed to access OneDrive. Approve the request.

Approve Kasm access to OneDrive

Approve Kasm
  1. Kasm redirects you to the Workspaces dashboard. The new storage mapping appears in the Cloud Storage section of the profile.

The OneDrive storage mapping in the profile

Storage Mapping
  1. Launch a new container-based session. Confirm that OneDrive is mapped inside the session at the /onedrive location.

OneDrive files mapped inside a session

In Session View