Profile

This property sets the OCI profile to use from the token authentication configuration file.

Declaration

// C#
public string Profile { set; }

Exceptions

An InvalidOperationException will be raised if the application tries to modify an ociTokenAuthenticationConfiguration object by setting this property once a connection has opened using that configuration object.

Remarks

This parameter is applicable to the OCI API key and OCI interactive authentication flows only and is optional.

ODP.NET uses the DEFAULT profile if no profile value is set.

Sample Code

OracleConnection conn = new OracleConnection(constr);
conn.TokenAuthentication = OracleTokenAuth.OciInteractive;
OciTokenAuthentication tokenconfig = new OciTokenAuthentication{
	ConfigurationFile = "<CONFIGURATION FILE>",
	Profile = "<PROFILE>",
	Compartment = "<COMPARTMENT OCID>",
	Database = "<DATABASE OCID>"
}
conn.UseOciTokenAuthentication(tokenConfig);
conn.Open();
conn.Close();