USER MANUALS


Connecting to Virtual DataPort Using OAuth Authentication

The Denodo JDBC driver supports the OAuth 2.0 protocol for authentication and authorization of users. OAuth is an open-standard protocol that allows client applications to access Denodo without sending the password of the user account.

Before using OAuth to connect to Virtual DataPort, you have to enable OAuth in Virtual DataPort. Otherwise, the connections with OAuth will fail.

Denodo provides three paths to connect to Denodo using OAuth. Depending on the one you choose you have to add certain parameters or others. You can indicate these parameters either as parameters of the connection URL or as driver properties.

Path #1: OAuth 2.0 Authentication providing access token

The client application obtains an OAuth access token and passes it to the Denodo JDBC driver. Then, the driver uses this token to connect to Virtual DataPort.

This path is meant to be used by client applications that have the ability to obtain access tokens to connect to Virtual DataPort. This client application can obtain this access token for itself or on behalf of the end user of the application.

For this method, add the following parameter to the connection URL or as a driver properties:

Parameters for OAuth 2.0 authentication with access token

Property

Value

useOAuth2

true

accessToken

The OAuth 2.0 access token

Do not provide user or password.

Path #2: OAuth 2.0 by Resource Owner Password Credentials

If the client application does not have the ability of obtaining OAuth tokens, the driver can obtain one on behalf of the application, if the Identity Provider of your organization supports the Resource Owner Password Credentials OAuth flow.

In this case, you configure the connection with information about the Identity Provider. That is, the URL to request tokens to the Identity Provider, client id and client secret of the application you registered on the Identity Provider, etc.

When the client application opens a connection, the driver will request an OAuth token to the Identity Provider and will use that token to establish the connection.

For this method, add the following URL parameters to the connection URL:

Parameters for OAuth 2.0 authentication with Resource Owner Password Credentials

Property

Value

useOAuth2

true

user

The username provided by the client to obtain an access token

password

The password corresponding to the user that will be authenticated

tokenEndpoint

URL exposed by OAuth server to request the access token

clientId

Application’s Client ID. Usually, you obtain this when registering the client application in the Identity Provider.

clientSecret

Application’s Client secret

scope

String value of the different scopes requested

extraParams

Additional parameters that will be added to the body of the HTTP request the driver will send to obtain the OAuth tokens.

The syntax of this parameter is: param1=value1&param2=value2&...

You have to indicate this as a driver property, not a parameter in the connection URL.

useIdToken

If true, the driver will use the “id_token” for authentication. If false, it uses “access_token”.

Set this to true in an environment with “OpenID Connect”.

Default value: false

oauthSSLVerify

If true, the driver will validate the SSL certificate of the Identity Provider. If false, it will not validate the certificate.

Default value: true

Path #3: OAuth 2.0 by Client Credentials

In a similar way to the previous path, if the Identity Provider of your organization supports the Client Credentials OAuth flow, you can configure the driver to obtain the token without identifying any user.

For this method, add the following URL parameters to the connection URL:

Parameters for OAuth 2.0 authentication with Resource Owner Password Credentials

Property

Value

useOAuth2

true

tokenEndpoint

URL exposed by OAuth server to request the access token

clientId

Application’s Client ID. Usually, you obtain this when registering the client application in the Identity Provider.

clientSecret

Application’s Client secret

scope

String value of the different scopes requested

extraParams

Additional parameters that will be added to the body of the HTTP request the driver will send to obtain the OAuth tokens.

The syntax of this parameter is: param1=value1&param2=value2&...

You have to indicate this as a driver property, not a parameter in the connection URL.

useIdToken

If true, the driver will use the “id_token” for authentication. If false, it uses “access_token”.

Set this to true in an environment with “OpenID Connect”.

Default value: false

oauthSSLVerify

If true, the driver will validate the SSL certificate of the Identity Provider. If false, it will not validate the certificate.

Default value: true

Do not provide user or password.

Path #4: OAuth 2.0 by Authorization Code grant or Multi factor Authentication (MFA)

If the Identity Provider of your organization needs to use a Multi factor Authentication with Oauth, the Authorization code OAuth flow is the most suitable for this scenario, you can configure the driver to obtain the token in this way.

For this method, add the following URL parameters to the connection URL:

Parameters for OAuth 2.0 authentication with Authorization Code grant credentials

Property

Value

useOAuth2

true

grantType

Indicates the expected flow to be used. The available values are: code (for Authorization code), password (for Resource Owner Password Credentials), clients_credentials (for Clients Credentials) and refresh_token (for Refresh Token).

tokenEndpoint

URL exposed by OAuth server to request the access token

authorizationEndpoint

URL exposed by the OAuth server and used to request the authorization code

clientId

Application’s Client ID. Usually, you obtain this when registering the client application in the Identity Provider.

clientSecret

Application’s Client secret

scope

String value of the different scopes requested

refreshToken

Refresh token to get a new access token if the provided one is expired.

extraParams

Additional parameters that will be added to the body of the HTTP request the driver will send to obtain the OAuth tokens.

The syntax of this parameter is: param1=value1&param2=value2&...

You have to indicate this as a driver property, not a parameter in the connection URL.

useIdToken

If true, the driver will use the “id_token” for authentication. If false, it uses “access_token”.

Set this to true in an environment with “OpenID Connect”.

Default value: false

oauthSSLVerify

If true, the driver will validate the SSL certificate of the Identity Provider. If false, it will not validate the certificate.

Default value: true

state

If true, the requests to the authorization endpoint will include the state parameter in order to prevent cross-site request forgery. If false, state parameter will not be included in requests.

Default value: true

oauthServiceTimeout

The timeout duration, in seconds, that the service responsible for obtaining an authorization code will wait for a response. It specifies the maximum time the service will remain idle while awaiting a reply during the authorization process.

Default value: 120

oauthServiceMinPort

This parameter specifies the lower bound of the port range to be used by the service responsible for obtaining an authorization code.

Default value: 8000

oauthServiceMaxPort

This parameter specifies the upper bound of the port range to be used by the service responsible for obtaining an authorization code.

Default value: 9000

oauthCredentialsCacheFilePath

File path to a file where the tokens will be stored to avoid perform unnecessary requests to the identity provider. The stored tokens are ciphered. This parameter is optional.

usePKCE

If true, the requests to the authorization endpoint will include Proof Key for Code Exchange (PKCE) in order to prevent CSRF and authorization code injection attacks. If false, PKCE parameter will not be included in requests.

Default value: true

It is highly recommended to set a credentials cache file (oauthCredentialsCacheFilePath) to avoid open unnecessary tabs in the web browser when the client application implements some kind of connection pool.

There are a second option for MFA flow, which is the Refresh Token. If we have a previous refresh token we can configure the ‘refreshToken’ property with a valid refresh token (and also filling the other driver properties from the table). Also if we have already used the Authorization code grant flow and configured a oauthCredentialsCacheFilePath, we can change the driver property ‘grantType’ to use ‘refresh_token’, in this way we will use the stored information to get a new access token when it expires.

Add feedback