OAuth 2.0 authentication
- Last Updated: June 7, 2023
- 1 minute read
- DataDirect Connectors
- JDBC
- Autonomous REST Connector 6.0
- Documentation
The Model 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 a Model file allows you to centrally configure and manage certain OAuth 2.0 settings for all connections using that file.
#authentication entry, which is used for custom authentication
flows. The following demonstrates the syntax used for specifying OAuth 2.0 settings in the Model 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.
"#authenticationMethod":"OAuth2"
"#authUri":"<auth_uri>"
"#logoffUri":"<log_off_uri>"
"#redirectUri":"<token_uri>"
"#scope":"<scope>"
"#tokenUri":"<token_uri>"
| 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"