TokenAuthentication

This property sets the value for TOKEN_AUTH parameter for the connection.

Declaration

// C#
public OracleTokenAuth TokenAuthentication { get; set; }

Remarks

The value of this property will be part of connection pool manager identification so different values for this property will result in different connection pools.

Table 6-50 OracleTokenAuth Members

Member Name Description

AzureServicePrincipal

Token authentication enabled for Azure AD service principal

Not available in ODP.NET, Unmanaged Driver

AzureManagedIdentity

Token authentication enabled for Azure AD managed identity

Not available in ODP.NET, Unmanaged Driver

AzureInteractive

Token authentication enabled for Azure AD using interactive authentication method

Not available in ODP.NET, Unmanaged Driver

AzureDeviceCode

Token authentication enabled for Azure AD using device code method

Not available in ODP.NET, Unmanaged Driver

AzureDefault

Token authentication enabled for Azure AD using default method

Not available in ODP.NET, Unmanaged Driver

Disabled

Default value. Token authentication is DISABLED.

OciApiKey

Token authentication using OCI_API_KEY authentication flow.

Not available in ODP.NET, Unmanaged Driver

OciInstancePrincipal

Token authentication using OCI_INSTANCE_PRINCIPAL authentication flow.

Not available in ODP.NET, Unmanaged Driver

OciResourcePrincipal

Token authentication using OCI_RESOURCE_PRINCIPAL authentication flow.

Not available in ODP.NET, Unmanaged Driver

OciDelegationToken

Token authentication using OCI_DELEGATION_TOKEN authentication flow.

Not available in ODP.NET, Unmanaged Driver

OciInteractive

Token authentication using OCI_INTERACTIVE authentication flow.

Not available in ODP.NET, Unmanaged Driver

OciDefault

Token authentication using the most appropriate method depending on the application environment. ODP.NET first attempts to retrieve the token using the OCI API key. If that fails, then ODP.NET checks whether it is in a Cloud Shell environment to attempt to get the token using delegation token authentication flow. Lastly, it attempts to use the instance principal authentication flow.

Not available in ODP.NET, Unmanaged Driver

OciToken

Token authentication is enabled for Oracle Identity and Access Management.

OAuth

Token authentication enabled for Azure Active Directory.

Exceptions

An InvalidOperationException will be raised if

  • the connection is already open,

  • the value of the AccessToken property is not compatible with the type of token authentication being set,
  • TokenAuthentication is set to disabled and the AccessToken or TokenLocation properties are set,

  • TokenAuthentication is set to a value other than disabled, and the Credential property is set,

  • the user or proxy information in the connection string is not compatible with token authentication,

  • if user id value is other than /,

  • password, proxy user id, and proxy password is set,

  • TokenConfiguration is specified, and TokenAuthentication is set to OciToken, OAuth, or Disabled.