OpenWithNewClientSecret

This method opens a new connection using a new Azure AD client secret.

Declaration

// C#
public static void OpenWithNewClientSecret(this OracleConnection @this, SecureString clientSecret)

Parameters

clientSecret – new client secret SecureString object reference

Exceptions

  • ArgumentNullException is raised if new client secret is passed in as null.

  • ArgumentException is raised if new client secret length is 0 or if corresponding secure string is not set as readonly.

  • InvalidOperationException - The connection is already opened or TokenAuthentication property is not set to AzureServicePrincipal.

  • OracleException – For token authentication, errors include "ORA-50109: Configuration for token-based authentication is invalid"

Description

ODP.NET uses the new client secret value to open a new connection. If the new connection opens successfully, then this new client secret is cached with the connection pool. If the new connection fails to open successfully, then an exception is thrown and the new client secret is ignored.

Remarks

This method is recommended only for when the current Azure client secret expires or opening a connection with a different client secret.

ODP.NET does not check whether the new client secret is the same value or reference as the existing cached client secret in the connection pool.

This method should successfully open an entirely new connection and connection pool even if there is no existing connection pool associated.