Google Drive

Enhanced Advanced

Create OAuth2 developer application in Google

The Google Cloud administrator registers an OAuth Client ID in Google.

Create Google OAuth integration.

They will need the Posit Connect redirect URL which is defined as https://connect.example.org/__oauth__/integrations/callback

Note

Replace connect.example.org with the address of the Connect server.

The Connect Administrator must obtain the client ID and client secret from the Google Cloud administrator.

Note

Google requires Confidential OAuth clients. Public clients are not allowed.

Transfer information to Connect administrator

The Google administrator shares the following information with the Connect administrator:

Field Description
client_id The unique identifier of the Google Oauth application.
client_secret The secret string for the Google OAuth application.
scopes The permissions requested by Connect. See the discussion on Scopes below for additional details.

Scopes

APIs and Services that are enabled for your Google Cloud project can be set within your Google Drive OAuth integration using scopes. By default the read and write Google Drive scope is included with the Drive OAuth integration, but scopes can be modified to be less permissive.

For more information, please see the full list of Drive API OAuth2 scopes.

Create OAuth integration in Connect

The Connect administrator creates an OAuth integration through the Integrations tab on the Connect dashboard. Once the OAuth integration has been created in Connect, it is available for use by all publishers.

Create Google Drive OAuth integration.

Alternatively, the example below shows how to create a Google Drive OAuth integration using curl and the Connect Server API.

Note

Replace connect.example.org with the address of the Connect server.

Terminal
curl -H "Authorization: Key ${CONNECT_API_KEY}" \
  -XPOST https://connect.example.org/__api__/v1/oauth/integrations \
  --data '{
    "template": "drive",
    "name": "Google Drive",
    "description": "A helpful description for publishers to use when choosing an OAuth integration for their content.",
    "config": {
      "client_id": "<client-id>",
      "client_secret": "<client-secret>",
      "auth_mode": "Confidential",
      "scopes": "https://www.googleapis.com/auth/drive"
    }
  }'
# 200 OK
# {"guid": "<oauth-integration-guid>", ... }