OAuth 2.0 access token example
- Last Updated: July 2, 2025
- 1 minute read
- DataDirect Connectors
- JDBC
- Documentation
You may configure the driver to access Google Analytics resources using OAuth 2.0. In the connection URL, you may provide an access token to connect. However, it should be noted that, in most cases, an access token is available for a short period of time and may only be used for a single session.
The following connection URL uses an access token.
jdbc:datadirect:googleanalytics:AccessToken=access_token;[property=value[;...]];
where:
- access_token
- specifies the access token required to authenticate to Google Analytics. This property allows you to set the access token manually.
- property=value
- specifies connection property settings. Multiple properties are separated by a semi-colon.
The AccessToken and RefreshToken properties may both be specified. If a value for the AccessToken property is not specified, the driver uses the value of the RefreshToken property to make a connection. If both values are not specified, the driver cannot make a successful connection. If both are specified, the driver ignores the AccessToken value and uses the RefreshToken value to generate a new AccessToken value.
For information on setting up OAuth 2.0 authentication, including obtaining access and refresh tokens, see OAuth 2.0 authentication.