OAuth 2.0 access token flow
- Last Updated: May 13, 2025
- 1 minute read
- DataDirect Connectors
- JDBC
- HubSpot 6.0
- Documentation
Typically, an OAuth 2.0 grant type or access flow is handled by the application. However, in some scenarios, you may need to secure an access token using external processes. In those instances, you can use the access token flow to access the service manually.
Note: Access tokens are temporary and must be replaced to maintain the
session without interruption. The life of an access token is typically six hours.
The following string includes the properties used to connect with the OAuth 2.0 access token flow.
jdbc:datadirect:hubspot:AuthenticationMethod=OAuth2;
AccessToken=access_token;[property=value[;...]];
where:
- access_token
- specifies the access token required to authenticate to HubSpot. 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 following example connection string includes the properties required for connecting with the OAuth 2.0 access token flow.
Connection conn = DriverManager.getConnection
("jdbc:datadirect:hubspot:AuthenticationMethod=OAuth2;
AccessToken=abcDEF123ghi-456Jklmno789-Pqrst01234;");