To use Google Drive as an external data source, create an authentication provider for it in Salesforce. The process begins with creating a related project in the Google Developers console.
Required Editions
| Available in: Salesforce Classic |
| Available in: Professional, Enterprise, Performance, Unlimited, and Developer Editions |
| User Permissions Needed | |
|---|---|
| To create authentication providers: |
Customize Application AND Manage Auth. Providers |
For detailed visuals, tips, and troubleshooting, see the Files Connect Setup Guide and User Guide.
- Using the credentials of your Google App for Work admin account, log in to https://console.cloud.google.com.
- In the title bar, expand Select Project and click Create Project.
- Enter a project name and location, and click Create.
- In the project dashboard, click the menu icon in the upper left, and then click APIs & Services.
- In the API manager, go to the Library tab and search for Google Drive API.
- In the search results, click Google Drive API, and then click Enable API.
- In the menu on the left, click Credentials.
- In the OAuth Consent Screen tab, enter a valid email address and application name, and click Save.
- In the Credentials tab, click Add credentials, and select OAuth client ID.
- Select Web application, and click Create.
-
Copy the client ID and client secret values to a text file.
Use these values next, when you create an authentication provider in Salesforce.
- In Setup, enter Auth. Providers in the Quick Find box, then select Auth. Providers.
- Click New.
-
For Provider Type, select OpenID Connect,
and then set the following options:
- Name — Enter the name you want to appear in Salesforce.
- URL Suffix — Enter the suffix at the end of the URL path. For example, in the path, https://login.salesforce.com/services/authcallback/00Dx00000000001/MyGoogleProvider, the suffix is “MyGoogleProvider”
- Consumer Key — Enter the client ID you copied when creating the Google project.
- Consumer Secret — Enter the client secret you copied when creating the Google project.
- Authorize Endpoint URL —Enter https://accounts.google.com/o/oauth2/auth?access_type=offline&approval_prompt=force
- Token Endpoint URL — Enter https://accounts.google.com/o/oauth2/token
- Default Scopes — Enter openid email profile https://www.googleapis.com/auth/drive
- Click Save.
- At the bottom of the Auth. Provider detail page, copy the Callback URL entry to a text file. Use this URL when you edit the Google project next.
- In the API Manager, in the menu on the left, click Credentials.
- Click the previously created web app.
- In the Authorized Redirect URIs section, add the Callback URL you copied when creating the authentication provider in Salesforce, and click Save.