The access token authentication flow employs a simple authentication flow that passes the access token directly from the client to the REST service for authentication. The access token is obtained from external resource or from tools, such as the Configuration Manager or Postman, and specified using the AccessToken property.
Note: As opposed to using a third-party application such as Postman, you can use the Progress DataDirect Autonomous REST Connector Configuration Manager to obtain an access token to support the access token flow. See Obtaining access and refresh tokens using the Configuration Manager for details.
To configure the driver to use an access token authentication flow:
  • The application should be configured to set the Access Token (AccessToken) option to specify the access token required to authenticate to a REST service.
    Note: Access tokens typically expire ten minutes after generation. Once connected, the access token remains valid till the session is disconnected.
  • Configure the minimum options required for a connection:
    • If you are using a Model file, set the REST Config File (RestConfigFile) option to provide the name and location of the Model file. For example, C:/path/to/yelp.rest.
    • If you are using the REST Sample Path method, set the REST Sample Path (RestSamplePath) option to specify the endpoint that you want to connect to and sample. For example, https://example.com/countries/.
  • Set the Authentication Method (AuthenticationMethod) option to 50 (OAuth2-Access Token).
    Note: To support existing configurations, the Authentication Method option will continue to support the 24 (OAuth2) value for the access token flow.
  • Optionally, specify values for a custom HTTP header to be used for authentication, such as those used in tenant ID authentication:
    • Set the Authentication Header (AuthHeader) option to specify the name of the HTTP header used for authentication.
    • Set the Security Token (SecurityToken) option to specify the value of the HTTP header named by the Authentication Header option.

    For example, if you have a header value of Authorization:1a2bc34def567, you would specify a values of AuthHeader=Authorization and SecurityToken=1a2bc34def567.

    Note: You can specify multiple custom HTTP headers using the #headers in the Model file. See "Requests with custom HTTP headers" for details.

The following example demonstrates a basic Yelp session using an access token flow:

Using a connection URL:

DRIVER=DataDirect 8.0 Autonomous REST Connector;
       AccessToken=C3TQH9zjwek4CgJCU-4Mxb2DxLNfI2LB3a-dNfpWYx;
       AuthenticationMethod=50;RestConfigFile=C:/path/to/yelp.rest;

Using an odbc.ini file with a 32-bit driver:

Driver=ODBCHOME/lib/ivautorestxx.so;
Description=My Autonomous REST Data Source
...
AuthenticationMethod=50
...
RestConfigFile=C:/path/to/yelp.rest
...
Note: The AccessToken option is not usually defined in data source definitions due to the short lifespan of access tokens.