skip to main content
Input REST file syntax : OAuth 2.0 authentication
  

Try DataDirect Drivers Now

OAuth 2.0 authentication

The input REST file supports a set of entries that can be used for OAuth 2.0 authentication. As opposed to specifying these values in a connection string or data source, using an input REST file allows you to centrally configure and manage certain OAuth 2.0 settings for all connections using that file.
Note: The OAuth 2.0 authentication entries described in this section are mutually exclusive from #authentication entry, which is used for custom authentication flows.
The following demonstrates the syntax used for specifying OAuth 2.0 settings in the REST file. Note that different authentication flows, or grant types, require a different set of credentials and authentication locations to successfully authenticate. Therefore, not all of these entries will be used for every flow. If you are unsure of your requirements, contact your system administrator.
Note: Entries that correspond to properties that specify confidential information, such as ClientID and ClientSecret, are not supported in the input REST file. Values for these properties should be passed in a connection string or by the application.
"#authenticationmethod":"OAuth2"
"#authuri":"<auth_uri>"
"#logoffuri":"<log_off_uri>"
"#redirecturi":"<token_uri>"
"#scope":"<scope>"
"#tokenuri":"<token_uri>"
Table 26. Supported Auth2.0 entries
Entry
Description
#authenticationmethod
Determines which authentication method the driver uses during the course of a session. Set this value to OAuth2.
#authuri
Specifies the endpoint for obtaining an authorization code from a third-party authorization service
#logoffuri
Specifies the endpoint the driver calls to notify the service to log the client out of the session, including performing any clean-up tasks or expiring the token.
#redirecturi
Specifies the endpoint to which the client is returned after authenticating with a third-party service.
#scope
Specifies a space-separated list of OAuth scopes that limit the permissions granted by an access token.
#tokenuri
Specifies the endpoint used to exchange authentication credentials for access tokens. For example, https://example.com/oauth2/authorize/.

Examples

The following examples demonstrate potential entries for common authentication flows.
Authorization code grant:
"#authenticationmethod":"OAuth2"
"#redirecturi":"http://localhost"
"#tokenuri":"https://example.com/oauth2/token"
Client credentials, Password, and Refresh token grants:
"#authenticationmethod":"OAuth2"
"#tokenuri":"https://example.com/oauth2/token"