Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

kerberos authentication with ODP.NET unmanaged driver C#.NET

Vishal GawaiOct 29 2021

I want to use kerberos authentication with ODP.NET unmanaged driver. I can connect using "SQLPLUS /@UAT_APP"
I have developed a simple C# console application targeting to .NET framework 4.6.1 below is the code:

DbProviderFactory factory = DbProviderFactories.GetFactory("oracle.dataaccess.client");
 var con = factory.CreateConnection();
 con.ConnectionString = "Data Source=UAT_APP;";
 con.Open();

App.config

oracle.dataaccess.client>
    <settings>
        <add name="FetchSize" value="131072"/>
        <add name="StatementCacheSize" value="10"/>
        <add name="TraceFileName" value="C:\Temp\odp.trc"/>
        <add name="TraceLevel" value="127"/>
        <add name="TraceOption" value="0"/>
        <add name="SQLNET.AUTHENTICATION_SERVICES" value="Kerberos5"/>
        <add name="SQLNET.KERBEROS5_CONF" value="C:\Apps\oracle\network\admin\krb5.conf"/>
        <add name="TNS_ADMIN" value="C:\Apps\oracle\network"/>
    </settings>
</oracle.dataaccess.client>

I get error:

Oracle.DataAccess.Client.OracleException: 'ORA-1017: invalid username/password; logon denied'

I have installed Oracle client 12c x64
Please let me know how to use Kerberos Authentication using ODP.NET unmanaged data access driver.

Comments
Post Details
Added on Oct 29 2021
13 comments
2,085 views