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 Google Drive storage provider

The Google Drive storage provider lets end users map their Google Drive storage into container-based sessions. Access is provided through the Google Drive OAuth interface and the Rclone Docker volume plugin. For reference, see the Google OAuth2 documentation and the Rclone Drive documentation.

Create a Google OAuth app

  1. Log in to the Google Developer Console.
  2. From the APIs & Services menu, select OAuth consent screen.
  3. Select External, then click Create.
caution

This example creates an integration where any Google user can authenticate with the Google Drive storage provider, which is ideal for a public-facing deployment. Choose Internal when only users from your Google Workspace corporate account should authenticate. External types must complete a validation process before use in production systems.

Create the OAuth consent screen

OAuth Consent
  1. Provide values for the App Name, User support email, and Developer Contact email.
  2. In the Authorized Domains section, enter the top private domain of the Workspaces deployment, for example example.com.
  3. Click Save and Continue.

OAuth consent registration

OAuth Registration
  1. Click Add or Remove Scopes.
  2. In the Update Selected Scopes window, check .../auth/drive, then click Update. When the option is not available, add https://www.googleapis.com/auth/drive to the Manually add scope field and click Add To Table.

Select the OAuth drive scope

OAuth Scope
  1. Click Save and Continue.
  2. Until the app is fully verified and published, it can only authenticate specific test accounts. Click Add Users to authorize several test Google accounts.
  3. Click Save and Continue.
  4. In the APIs & Services menu, select Credentials.
  5. Select Create Credentials, then OAuth client ID.

Create an OAuth client ID

Client ID
  1. Select Web Application as the Application type, then give the client a name such as Kasm.
  2. Click Add URI in the Authorized redirect URIs section, and enter https://<kasm deployment hostname>/api/cloud_storage_callback.
  3. Click Create.

Create the OAuth client

Create Client
  1. A dialog displays a Client ID and Client Secret. Save these values for the next section. The JSON download also includes URLs needed for the next section.

OAuth client ID and secret

Client Secret
  1. From the main menu of the Google Cloud Console, search for Google Drive API. Open the page, then click Enable when the option is available. No action is needed when the status is already enabled.

Enable the Google Drive API

Enable Drive

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
NameGoogle Drive
Storage Provider TypeGoogle Drive
Enabledchecked
Client ID<client id>
Client Secret<client secret>
Authorization URLhttps://accounts.google.com/o/oauth2/auth
Authorization URL Options{"include_granted_scopes" : "true", "prompt" : "select_account consent", "access_type" : "offline"}
Token URLhttps://oauth2.googleapis.com/token
Redirect URLhttps://<hostname>/api/cloud_storage_callback
Scopehttps://www.googleapis.com/auth/drive
Default Target/gdrive
Volume Config{ "driver" : "rclone", "driver_opts" : { "type" : "drive", "uid" : "1000", "gid" : "1000", "allow_other" : "true" } }
Mount Config{}
  1. Click Save.

Google Drive 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 Google Drive from the drop-down, then select Next.

Configure the Google Drive storage mapping

Configure Storage
  1. The Google login page appears. Log in with the desired account. This account must be a test user from the OAuth app creation process.

Log in to Google

Login
  1. When the Google OAuth app is not yet approved, a warning appears. Click Continue.

Approve Kasm access to Google Drive

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

The Google Drive storage mapping in the profile

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

Google Drive files mapped inside a session

In Session View