Create an Authentication Provider for Google Drive | Salesforce
Create an Authentication Provider for Google Drive
To use Google Drive as an external data source, you must create an authentication provider for it in Salesforce. The process begins with creating a related project in the Google Developers console.
|Available in: Salesforce Classic|
|Available in: Professional, Enterprise, Performance, Unlimited, and Developer Editions|
|To create authentication providers:||“Customize Application”|
“Manage Auth. Providers”
Create a Project in the Google Developers Console
- Using the credentials of your Google App for Work admin account, log in to https://console.cloud.google.com.
- In the title bar, expand Go to Project and click Create Project.
- Enter a project name, and click Create.
- In the project dashboard, click the menu icon in the top left, then click API Manager.
- In the API manager, go to the Google APIs tab and search for Google Drive API.
- Click Google Drive API in the search results, then click Enable API.
- Click Credentials, located in the left-hand menu.
- In the OAuth Consent Screen tab, enter a valid email address and product name. Then 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. You’ll use these values when creating an authentication provider in Salesforce.
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. Then, at the bottom of the Auth. Provider detail page, copy the Callback URL entry to a text file. (You’ll use this when editing the Google project.)
Edit the Project in the Google Developer Console
- In the API Manager, click Credentials, located in the left-hand menu.
- Click on the previously created Web application.
- In the Authorized Redirect URIs section, add the Callback URL you copied when creating the authentication provider in Salesforce.
- Click Save.