oracle / dotnet-db-samples

.NET code samples for Oracle database developers #OracleDotNet
http://otn.oracle.com/dotnet
MIT License
408 stars 190 forks source link

Oracle.ManagedDataAccess.Client.OracleException (0x80004005): ORA-28040: The database does not accept your client's authentication protocol; login denied. #386

Closed murat16ertekin closed 1 month ago

murat16ertekin commented 1 month ago

Hello;

In our project where we work with Oracle 12c version and in our project developed with .Net 8; I upgraded the Oracle.EntityFrameworkCore version from 8.21.140 to 8.23.40 and started getting errors when connecting to the database. The error is caused by outdated Oracle versions being out of support by default.

Oracle EntityFrameworkCore-Issue-1

murat16ertekin commented 1 month ago

When the client version is set in the OnConfiguring method in the DbContext class, the connection is established once and then it gives an error again.

OracleConfiguration.SqlNetAllowedLogonVersionClient = OracleAllowedLogonVersionClient."ORACLE_VERSION"

Oracle EntityFrameworkCore-Issue-2-1

Oracle EntityFrameworkCore-Issue-2

murat16ertekin commented 1 month ago

The problem was solved when the client version was set in the OnModelCreating method in the DbContext class.

OracleConfiguration.SqlNetAllowedLogonVersionClient = OracleAllowedLogonVersionClient.ORACLE_VERSION

Oracle EntityFrameworkCore-Issue-2-2

alexkeh commented 1 month ago

Duplicate of https://github.com/oracle/dotnet-db-samples/issues/379

Happy to see you were able to resolve the issue.