Obtaining access and refresh tokens using the Configuration Manager
- Last Updated: April 14, 2023
- 2 minute read
- DataDirect Connectors
- ODBC
- Documentation
You need the following information before you begin.
- The client ID and client secret for the client application
- The scope or scopes that define permissions for the client application
The Configuration Manager uses the authorization code grant to obtain access and refresh tokens from Google Cloud. The following steps describe how you can use the Configuration Manager to obtain access and refresh tokens. In addition, the Configuration Manager produces a connection URL that you can use in your application.
- .
For detailed information on launching the Configuration Manager, see "Configuring data sources with the Configuration Manager."
-
- Enter a connection string you provide by clicking the Edit button (
); then, pasting your string into the Connection String field. If you prefer, you can also type a string directly into this field.
- Enter values of the connection options you want to configure into the corresponding fields. The Google Analytics 4 Configuration Manager will generate a data source and connection string based on the values you specify.
- Enter a connection string you provide by clicking the Edit button (
- Enter values for the required connection options on the Connection
tab.
- Client ID
- Client Secret
- Scope
The following scopes are the default scopes used by the driver.
- View and download data:
https://www.googleapis.com/auth/analyticshttps://www.googleapis.com/auth/analytics.readonly
- View user
permissions:
https://www.googleapis.com/auth/analytics.manage.users.readonly
- View and download data:
- Enter any additional values under the Connection tab, or other tabs, as desired.
- Retrieve access and refresh tokens.
- Click Fetch OAuth Token.
- If prompted, enter Google credentials.
- Provide consent to allow the Configuration Manager to retrieve the tokens.
- The Access Token and Refresh Token fields populate with values retrieved from Google Cloud.
- Click Test Connect to verify connectivity and run SQL queries against the service.
Results:
The Access Token and Refresh Token fields contain access and refresh tokens. You can use these tokens to configure the driver and access Google Analytics resources.
The connection string in the Connection String field may be copied and used in your ODBC application to access Google Analytics resources.