Configure OAuth authentication for Google Cloud¶
The Snowflake connector for Google Analytics Aggregate Data is subject to the Connector Terms.
About customer-provided OAuth client authentication¶
An application that authenticates to Google using OAuth 2.0 must provide two objects in Google Cloud:
An OAuth consent screen that tells users who is requesting access to their data and what kind of data users are allowing your application to access.
An OAuth Client ID that is used to authenticate an application to Google. This is necessary when you want to access resources owned by your end user.
You must provide your own OAuth consent screen and client ID to authenticate.
Prerequisites¶
To provide the OAuth consent screen and OAuth client ID, you must first create a Google Cloud project. For information about creating Google Cloud projects, see the Google Cloud documentation.
Note
If possible, create an OAuth consent screen in a Google Cloud project that belongs to an organization. Ensure that the connector users are members of the same organization.
If your project does not belong to an organization, you must renew authentication every seven days.
Configure the OAuth consent screen¶
To open the OAuth consent screen creator, in your Google Cloud project, select APIs & Services » OAuth consent screen.
Select one of the following user types:
Internal: Select this user type only if the Google Cloud project belongs to an organization and the connector users are members of the same organization.
External: If you select this user type, you must renew authentication weekly.
Select Create.
Provide the following information:
App name: Snowflake Connector for Google Analytics Aggregate Data
User support email: your email address
Developer contact information: your email address
Select Save and continue.
Select Add or remove scopes » Manually add scopes.
Copy the following address:
https://www.googleapis.com/auth/analytics.readonly
Paste the address in the dialog, and then select Add to table.
Select Update.
If you selected the External user type, follow these steps:
Select Test users » Add users.
Enter the email addresses of users who are allowed to use the connector.
Select Add.
To finish the configuration, select Save and continue » Back to dashboard.
Configure the OAuth client ID¶
In this procedure, you acquire a redirect URL from Snowsight and paste it into your Google Cloud project.
In Snowsight, start the Snowflake Connector for Google Analytics Aggregate Data configuration wizard.
In the third step of the connector configuration, Authenticate Google Cloud Platform, copy the value from the Redirect URL section.
In your Google Cloud project, to open the OAuth consent screen creator, select APIs & Services » Credentials.
Select Create credentials » OAuth client ID.
In the Application type dropdown list, select Web application.
In the Name box, enter the following name: Snowflake Connector for Google Analytics Aggregate Data ID
Select Authorized redirect URIs » Add URI.
Select Create.
Copy the Your Client ID and Your Client Secret values.
Return to the Snowflake Connector for Google Analytics Aggregate Data interface, and paste the values into the corresponding boxes.
Select Sign in.
Prevent session expiration for the OAuth consent screen¶
In the Google Admin Console menu, select Security » Access and data control » Google Cloud session control.
In the Reauthentication policy section, select the Exempt Trusted apps checkbox.
In the Google Admin Console menu, select Security » API Controls » App Access Control.
In the Configured apps section, select Add app » OAuth App Name Or Client ID.
Copy the client ID created in Configure the OAuth client ID, and paste it in the box.
Select Search.
Select the Snowflake Connector for Google Analytics Aggregate Data application name.
Select the created OAuth Client ID checkbox, and then click Select.
In the Scope section, select All users.
Select Continue.
In the Access to Google Data section, select Trusted.
Select Continue.
On the Review screen, select Finish.