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 Redirect URI (RedirectURI) option.

Note: The strings demonstrated in this section use the DSN-less format. For additional formats, see "Using a connection string."
DRIVER=DataDirect 8.0 Aha;HostName=host_name;AuthenticationMethod=24;ClientID=client_id;
ClientSecret=client_secret;OauthCode=auth_code;RedirectURI=redirect_uri;
[attribute=value[;...]];

where:

host_name

specifies the base URL of the Aha! service to which you want to issue requests. For example, company.aha.io.

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.
auth_code
specifies the authorization code that is exchanged for the access token.
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.

attribute=value
specifies connection option settings. Multiple option attributes are separated by a semi-colon.

The following example connection string includes the options required for connecting with the OAuth 2.0 authorization code grant.

DRIVER=DataDirect 8.0 Aha;HostName=company.aha.io;AuthenticationMethod=24;
ClientID=cd34efg5678h9ij87klm6543no32pqr10st987;ClientSecret=098zyx765wvu432tsr123qpo456;
OauthCode=abc12cd34efg5678h9ij87klm6543no32pqr10;RedirectURI=https://lvh.me/app_callback.html