Files Connect: Setup with Google Drive
|Knowledge Article Number||000239696|
|Description||This KB article contains simplified steps to setup Files Connect feature with Google Drive.|
|Resolution||Files Connect - Google Drive Setup:
1. Create a Project in Google Developers Console
2. Click Create Project
3. Enter a project name, and click Create.
4. On the Overview page, click on Drive API (under Google App APIs)
5. Click Enable
6. Click Credentials on the left-hand menu
7. Click on OAuth consent screen tab on top, enter a valid email address, and product name
8. Click in the Credentials tab, click on Create credentials and select OAuth client ID
9. Select Web application and click Create
10. Save the client ID and client secrt on the next popup window (we will need these values when creating an authentication provider in Salesforce)
11. Login to Salesforce and ensure Files Connect is enabled and the user has "Files Connect Cloud" Profile or Permission set assigned per Help and Training documentation
12. In Setup, enter Auth. Providers in the Quick Find box, then select Auth. Providers.
13. Click New
14. For Provider Type, select Open ID Connect, and then set the following options 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
15. 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.)
16. Log back in Google API Manager, click Credentials on the left-hand menu
17. Click on the previously created Web application
18. In the Authorized Redirect URIs section, add the Callback URL you copied when creating the authentication provider in Salesforce.
19. Click Save
20. Log back in Salesforce, to define External Data Source for Google Drive
21. From Setup, enter External Data Sources in the Quick Find box, then select External Data Sources
22. Click New External Data Source. Then set the following options:
Label: A user-friendly name for the data source displayed in the Salesforce user interface.
Name: A unique identifier used to refer to this external data source definition through the API.
Type: Files Connect: Google Drive
Identity Type: Per User or Named Principal
Auth. Protocol: OAuth 2.0
Auth. Provider: The one we created above for Google Drive
Scope: Leave blank
Start Authentication Flow on Save Select to immediately test the settings abovw
23. Click Save
24. You will be re-directed to Google account to allow access, click Allow
25. Validate and Sync Google Drive external object
26. Salesforce Permission set: Create a new perm. set, save it with Salesforce license
27. Go to System Perm. and Edit
28. Enable Files Connect Cloud perm. and save
29. Click Manage Assignment to assign permset. to a user
30. Click on External Data Source (XDS) Access, click Edit
31. Add available "Google Drive" XDS to enabled list (not required for Named Principal identity type)
33. Go to Files tab, click on "Google Drive" XDS
34. Click "Click here to link your external account to Salesforce.", click Allow to give perm.
35. Click on "Google Drive" XDS and you should have access to the files stored in your Google Drive!