Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space DEV and version r092

D toc

Excerpt

This section describes the steps to configure the

D s webapp
rtrue
to integrate with
D s conntype
typegsheetsuser
using OAuth 2.0 to authenticate.

Prerequisites

  • OAuth 2.0 authentication must be enabled in the
    D s platform
    .
  • An OAuth 2.0 client is required for
    D s product
    productee
    only.
  • For more information, see Enable OAuth 2.0 Authentication.

Create OAuth 2.0 Client App for 
D s conntype
typegsheetsuser

Enable external user in project

You must enable external access to the project containing your 

D s conntype
typegsheetsuser
 data. 

Info

NOTE: This step configures access through the consent screen for your project. If you have already done this step for the project, you can skip this section.

Steps:

  1. Navigate to the Google Console for your project: https://console.cloud.google.com/.
  2. From the left menu, select APIs & Services > OAuth consent screen.
  3. For User Type, select External
  4. Click Create.
  5. You can provide a logo and name for this client. For example:

    Tip

    Tip: You can use your own logo and product name if preferred.

    1. Right-click the logo in the 
      D s webapp
       and download it to your desktop. Right-click the image and select Save As.... Upload it to the consent screen. 
    2. The name of the product can be: 

      D s product
      productee
      .

  6. Do not add Scopes or Test Users. 
  7. Save your changes.

Create OAuth 2.0 credentials

You must create a set of credentials to use when accessing your Google project. 

Steps:

  1. From the APIs & Services menu, select Credentials.
  2. At the top of the screen, click +CREATE CREDENTIALS
  3. Select OAuth client Id.
  4. For Application type, select Web application.
  5. Fill the values for the following settings:

    SettingValue
    NameProvide a descriptive name. Example: Google_Analytics
    Authorized JavaScript originsDo not add a value for this setting.
    Authorized Redirect URIs

    Set the value to the following:

    Code Block
    https://<login_url>:<port_number>/oauth2/callback


  6. Click Create.

  7. Retain the values for ClientId and Client Secret. These values must be applied in the 

    D s webapp
    .

Enable API access

You must enable API access to your project.

Steps:

  1. To enable the Google Sheets API, navigate to the following URL:
    https://console.cloud.google.com/apis/library/sheets.googleapis.com

  2. Click Enable.
  3. To use Google Sheets, you must also enable the Google Drive API. Navigate to the following URL:
    https://console.cloud.google.com/apis/library/drive.googleapis.com

  4. Click Enable.

Create OAuth 2.0 Client for 
D s conntype
typegsheetsuser

After the 

D s conntype
typegsheetsuser
 app is created, you must create an OAuth 2.0 client in the 
D s webapp
, which is used to integrate with the OAuth 2.0 connected app that you created above.

Info

NOTE: You must create one OAuth 2.0 client in the

D s webapp
for each
D s conntype
typegsheetsuser
connected app that you wish to use.

Steps:

  1. Login to the 
    D s webapp
     as a workspace administrator.
  2. In the lefthand menu, select User menu > Admin console > OAuth2.0 Clients
  3. In the OAuth2.0 Clients page, click Register OAuth2.0 Client.
  4. Specify the new client. Apply the following values:

    SettingDescription
    TypeSet to google_sheets.
    Name

    Display name for the OAuth 2.0 client in the

    D s webapp
    .

    Client ID

    Set this value to the Client Id value that you retained from your

    D s conntype
    typegsheetsuser
    app.

    Client Secret

    Set this value to the Client Secret value that you retained from your

    D s conntype
    typegsheetsuser
    app.

    Authorization URL

    Set this value to the following:

    Code Block
    https://accounts.google.com/o/oauth2/v2/auth
    Token URL

    Set this value to the following:

    Code Block
    https://oauth2.googleapis.com/token
    Scopes

    Please insert the following value:

    Code Block
    https://www.googleapis.com/auth/drive.readonly
    Access Token Expires InSet this value (in milliseconds) to 3600000 (1 hour).
    Refresh Token Expires In

    Set the value to 0 (does not expire).

  5. To save your OAuth 2.0 client, click Save.

For more information, see Create OAuth2 Client.

Create
D s conntype
typegsheetsuser
 Connection

After you have created the two OAuth 2.0 client references, you can create a connection to your

D s conntype
typegsheetsuser
 data.

Info

NOTE: You must create a separate connection for each OAuth 2.0 client that is available in the

D s webapp
.

For more information, see Google Sheets Connections.

D s also
labeloauth2