OAuth 2.0 access token flow
- Last Updated: October 5, 2022
- 1 minute read
- DataDirect Connectors
- JDBC
- Microsoft Dynamics 365 6.0
- Documentation
Note: As opposed to using a third-party
application such as Postman, you can use the Progress DataDirect Dynamics 365 Configuration
Manager to obtain an access token to support the access token flow. See Obtain access and refresh tokens using the
Configuration Manager for details.
Note: Access tokens are temporary and must
be replaced to maintain the session without interruption. The life of an access token is
typically one hour.
The following string includes the properties used to connect with the OAuth 2.0 access token flow.
jdbc:datadirect:dynamics365:ServiceURL=serviceurl;AuthenticationMethod=method;
AccessToken=access_token;[property=value[;...]];where:
- serviceurl
- specifies the base URL of the Dynamics 365 instance to which you want to issue requests. For example, https://mywebinstance.api.crm.dynamics.com/api/data/v9.1/.
- method
- specifies the authentication method used to connect to the service.
The default value is
OAuth2. SinceOAuth2is the default, this value does not have to be specified in a connection URL used for OAuth 2.0 implementations.
- access_token
- specifies the access token required to authenticate to Dynamics 365. 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 for connecting with the OAuth 2.0 access token flow.
Connection conn = DriverManager.getConnection
("jdbc:datadirect:dynamics365:
ServiceURL=https://mywebinstance.api.crm.dynamics.com/api/data/v9.1/;
AuthenticationMethod=OAuth2;
AccessToken=C3TQH9zjwek4CgJCU-4Mxb2DxLNfI2LB3a-dNfpWYx;");