skip to main content
Welcome to Progress DataDirect for ODBC for Microsoft Dynamics 365 Driver: Version 8.0.0 : Connection string examples : OAuth 2.0 refresh token grant
  

Try DataDirect Drivers Now

OAuth 2.0 refresh token grant

The refresh token grant is used to replace expired access tokens with active ones by exchanging the refresh token at the endpoint specified by the Token URI (TokenURI) option.
Note: The strings demonstrated in this section use the DSN-less format. For additional formats, see "Using a connection string."
Note: On Windows platforms, as opposed to using a third-party application such as Postman, you can use the Progress DataDirect Dynamics 365 Configuration Manager to obtain a refresh token to support the refresh token grant. See "Obtaining access and refresh tokens using the Configuration Manager" for details.
This string includes the option attributes used to connect with OAuth 2.0 authentication.
DRIVER=DataDirect 8.0 Microsoft Dynamics 365;ServiceURL=serviceurl;
ClientID=client_id;ClientSecret=client_secret;TokenURI=token_uri;
RefreshToken=refresh_token;[attribute=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/.
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.
token_uri
specifies the endpoint used to exchange authentication credentials for access tokens when OAuth 2.0 authentication is enabled.
refresh_token
specifies the refresh token used to either request a new access token or renew an expired access token.
Important: The refresh token is a confidential value used to authenticate to the server. To prevent unauthorized access, this value must be securely maintained.
attribute=value
specifies connection option settings. Multiple option attributes are separated by a semi-colon.
The following example connection string includes the attributes required for connecting with the OAuth 2.0 refresh token grant:
DRIVER=DataDirect 8.0 Microsoft Dynamics 365;ServiceURL=https://mywebinstance.api.crm.dynamics.com/api/data/v9.1/;
ClientID=29453d6f-6789-25gh-gd8g-44tk3c527831;ClientSecret=12a3=bCD/EfGh4Ijk+Lm5P67qR8s=//TuV+WXy1Zabcd;
TokenURI=https://login.microsoftonline.com/common/oauth2/v2.0/token;
RefreshToken=12a3=bCD/EfGh4Ijk+Lgd8g-44tk3c527831;