OpenWithNewToken(char[])

This method can be used to open a new connection by providing the refreshed/updated access token directly to ODP.NET instead of through the token refresh call back. It is recommended to be used only in cases the application is unable or fails to provide the refreshed/updated access token through the token refresh call back.

Declaration

// C#
public void OpenWithNewToken(char[] token)

Exceptions

  • ArgumentNullException is raised if token is passed in as null.

  • InvalidOperationException - The connection is already opened, or there is not an OracleAccessToken object set on the connection.

  • OracleException – For token authentication, errors include “ORA-25707: The token is invalid.”, and “ORA-25708: The token has expired.”

Description

ODP.NET uses the provided access token to open a new database connection. If the new connection is opened successfully, then the underlying OracleAccessToken object is updated with the new access token. If the driver fails to open the new connection, then an exception is thrown and the access token is ignored.

The char[] passed for the access token will be cleared ODP.NET for security reasons. The application should not depend on the char[] once this method is called.

For client-side validation of an access token:

  • The access token must be 16KB bytes or less.

  • There needs to be two periods, ".".

  • It must be valid base 64.

  • It must be valid JSON.

  • There must be "sub" and "exp" claims.