If your service does not support one of the standard authentication methods provided by the driver, you can define a custom authentication requests using the Model file.

Before you start: Define your custom authentication requests in the Model file. For details, see "Custom authentication requests."

To configure the driver to use custom authentication requests:
  • Set the REST Config File (RestConfigFile) option to provide the name and location of the Model file. For example, C:/path/to/myrest.rest.
  • Set the Authentication Method (AuthenticationMethod) option to 29 (Custom). Note that 29 is the default when a custom authentication request is defined in the Model file.
  • Optionally, set the Custom Auth Params (CustomAuthParams) option to specify the list of parameters to be used by the authentication requests defined in the Model file. Note that these values must be specified in the order that corresponds to the index location cited by the variable in the Model file. For example, the following customAuthParams variable points to the second (2) index:
    "company": "{customAuthParams[2]}"

    To successfully authenticate, the second value specified should be the value for the company field:

    CustomAuthParams=123XYZ456abc789;My Company Inc;www.example.com 
  • If applicable, set the Host Name (HostName) option to specify the host name portion of the HTTP endpoint to which you send requests. This value corresponds to the [ServerName] variable in the Model file.
  • If required by your service, set the User (User) option to specify your logon ID. This value corresponds to the [User] variable in the Model file.
  • If required by your service, set the Password (Password) option to specify your password. This value corresponds to the [Password] variable in the Model file.
  • Optionally, specify values for any additional options you want to configure.

The following examples demonstrate sessions using custom authentication, including the optional CustomAuthParams, HostName, User, and Password options.

For a connection URL:

DRIVER=DataDirect 8.0 Autonomous REST Connector;CustomAuthParams=123XYZ456abc789;
       My Company Inc;path/to/endpoint;HostName=https://example.com;
       RestConfigFile=C:/path/to/myrest.rest;User=jsmith;Password=secret"

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

Driver=ODBCHOME/lib/ivautorestxx.so;
Description=My Autonomous REST Data Source
...
CustomAuthParams=123XYZ456abc789;My Company Inc;path/to/endpoint;
...
HostName=https://example.com 
...
Password=secret
...
RestConfigFile=C:/path/to/myrest.rest
...
User=jsmith
...