OAuth 2.0 authorization code grant
- Last Updated: July 2, 2025
- 1 minute read
- DataDirect Connectors
- JDBC
- Aha! 6.0
- Documentation
Note: To use OAuth2 authentication, you must first register your application with Aha!.
Refer to the Aha! documentation for more information.
The authentication flow for the authorization code grant exchanges the authorization code and client credentials for the access token at the location specified by the RedirectURI.
jdbc:datadirect:aha:servername;AuthenticationMethod=OAuth2;oauthCode=auth_code;
ClientID=client_id;ClientSecret=client_secret;RedirectURI=redirect_uri;
[property=value[;...]];
where:
- servername
- specifies the base URL of the Aha! service to which you want to issue requests. For example, company.aha.io.
- auth_code
- specifies the authorization code that is exchanged for the access token.
- client_id
- specifies the client ID key for your application when authenticating with OAuth 2.0.
- client_secret
- specifies the client secret for your application when authenticating with OAuth
2.0.
Important: The client secret is a confidential value used to authenticate the application to the server. To prevent unauthorized access, this value must be securely maintained.
- redirect_uri
- specifies the endpoint that the client is returned to after authenticating with the service. This value is the same as the one specified in the OAuth application.
- 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 client credentials grant.
Connection conn = DriverManager.getConnection
("jdbc:datadirect:aha://company.aha.io;authenticationMethod=OAuth2;
oauthCode=abc12cd34efg5678h9ij87klm6543no32pqr10;
clientId=cd34efg5678h9ij87klm6543no32pqr10st987;
clientSecret=098zyx765wvu432tsr123qpo456;
redirectUri=https://lvh.me/app_callback.html;");