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 52 OracleTokenAuth Members
| Member Name | Description |
|---|---|
AzureServicePrincipal |
Token authentication enabled for Microsoft Entra ID service principal Not available in ODP.NET, Unmanaged Driver |
AzureManagedIdentity |
Token authentication enabled for Microsoft Entra ID managed identity Not available in ODP.NET, Unmanaged Driver |
AzureInteractive |
Token authentication enabled for Microsoft Entra ID using interactive authentication method Not available in ODP.NET, Unmanaged Driver |
AzureDeviceCode |
Token authentication enabled for Microsoft Entra ID using device code method Not available in ODP.NET, Unmanaged Driver |
AzureDefault |
Token authentication enabled for Microsoft Entra ID using default method Not available in ODP.NET, Unmanaged Driver |
Disabled |
Default value. Token authentication is DISABLED. |
OciApiKey |
Token authentication using Not available in ODP.NET, Unmanaged Driver |
OciInstancePrincipal |
Token authentication using Not available in ODP.NET, Unmanaged Driver |
OciResourcePrincipal |
Token authentication using Not available in ODP.NET, Unmanaged Driver |
OciDelegationToken |
Token authentication using Not available in ODP.NET, Unmanaged Driver |
OciInteractive |
Token authentication using Not available in ODP.NET, Unmanaged Driver |
OciDefault |
Token authentication using the most appropriate method for the application environment. ODP.NET tries OCI API key, delegation token (for Cloud Shell), resource principal, and instance principal, in that order. Not available in ODP.NET, Unmanaged Driver |
OciToken |
Token authentication is enabled for Oracle Identity and Access Management. |
OAuth |
Token authentication enabled for Microsoft Entra ID. |
Exceptions
An InvalidOperationException will be raised if
-
the connection is already open,
-
the value of the
AccessTokenproperty is not compatible with the type of token authentication being set, -
TokenAuthenticationis set to disabled and theAccessTokenorTokenLocationproperties are set, -
TokenAuthenticationis set to a value other than disabled, and theCredentialproperty 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,
-
TokenConfigurationis specified, andTokenAuthenticationis set toOciToken,OAuth, orDisabled.