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.

Google Drive Storage Provider Setup

The Google Drive Storage Provider allows end-users to map in their Google Drive storage into container-based sessions. Access is provided via Googles Drive's OAuth interface and leveraging the Rclone Docker volume plugin.

Reference Docs:

Creating a Google OAuth App

  1. Login to the Google Developer Console: https://console.developers.google.com.
  2. From the APIs & Services menu, Select OAuth consent screen.
  3. Select External then click Create.
warning

In this example, we walk through creating an integration where any Google user can auth with the Google Drive Storage Provider. This is ideal for a public facing deployment. Choose Internal if only users from your Google Workspace corporate account should be allowed to authenticate.

Extenal types will need to go through a validation process before being used in production systems.

OAuth Consent

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

OAuth Registration

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

OAuth Scope

OAuth Scope
  1. Click Save and Continue.
  2. Until the app is fully verified and published it can only be used to auth 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.

Client ID

Client ID
  1. Select Web Application as the Application type, then give the client a name (e.g 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 Client

Create Client
  1. A dialogue will display with a Client ID and Client Secret. Save these values for the next configuration steps. The JSON download will also include URLs needed for the next configuration steps.

Client Secret

Client Secret
  1. From the main menu of the Google Cloud Console , search for "Google Drive API". Navigate to the selected page, then click "Enable" if the option is available. No action is needed if the status is currently enabled.

Enable Drive

Enable Drive

Kasm Storage Provider Config

  1. Log into the Kasm UI as an administrator.
  2. Select Settings -> Storage -> Add.
  3. Update the form with the following entries, using the Client ID and Client Secret gathered in the previous section.
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 to save the changes.

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