skip to main content
Using the Driver : Authentication : OAuth 2.0 Authentication : Refresh Token Grant
  

Try DataDirect Drivers Now
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 option.
To configure the driver to use an authentication flow for a refresh token grant:
*Configure the minimum options required for a connection:
*If you are using an input REST file, set the REST Config File (RestConfigFile) option to provide the name and location of the input REST file. For example, C:/path/to/zendesk.rest.
*If you are using the REST Sample Path method, set the REST Sample Path (RestSamplePath) option to specify the endpoint that the want to connect to and sample. For example, https://example.com/countries/.
*Set the Authentication Method (AuthenticationMethod) option to OAuth2.
*Set the Client ID (ClientID) option to specify the client ID key for your application.
*Set the Client Secret (ClientSecret) option to specify the client secret for your application.
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.
*Set the Refresh Token (RefreshToken) option to specify the refresh token used to request a new access token or renew an expired one.
Important: The refresh token is a confidential value used to authenticate to the server. To prevent unauthorized access, this value must be securely maintained.
*Set the Token URI (TokenURI) option to specify the endpoint from which the driver fetches access tokens. For example, https://example.com/oauth2/authorize/.
*Optionally, set the Scope (Scope) option specify a space-separated list of OAuth scopes to limit the permissions granted by the access token.
The following examples demonstrate a Google Analytlics session using a refresh token grant:
Using a connection URL:
DRIVER=DataDirect 8.0 Autonomous REST Connector;AuthenticationMethod=OAuth2;
ClientID=1234567898-a1bc2de3fgh4ij567klmn8opqr9stu.apps.googleusercontent.com
Clientsecret=FaZBFRsGXTaR;RestConfigFile=C:/path/to/googleanalytics.rest;
RefreshToken=1/abCD0F1GHijkLmNOPqrs_T2VWx3Y-Zabc45dE6FGh;
TokenURI=https://accounts.google.com/o/oauth2/token;
Using an odbc.ini file with a 32-bit driver:
Driver=ODBCHOME/lib/ivautorestxx.so;
Description=My Autonomous REST Data Source
AuthenticationMethod=OAuth2;
ClientID=1234567898-a1bc2de3fgh4ij567klmn8opqr9stu.apps.googleusercontent.com
Clientsecret=FaZBFRsGXTaR
RefreshToken=1/abCD0F1GHijkLmNOPqrs_T2VWx3Y-Zabc45dE6FGh
RestConfigFile=C:/path/to/googleanalytics.rest
TokenURI=https://accounts.google.com/o/oauth2/token