I have been through a variety of different SO posts and questions trying to find an answer here, but so far I've had no luck, so I'm going to ask to see if anyone has anything newer to help.
My situation: I am working on a thick-client application built in Windows Forms (it's a legacy application that was resurrected recently with a low budget and REALLY short runway to production).
- Oracle 12.2c database, for which I do not have DBA privileges. Our security requirements will not allow our DBAs to change the
SEC_CASE_SENSITIVE_LOGON
toFALSE
(meaning it is set toTRUE
and must stay that way). - ODP.NET Managed Data Access DLL version 19.11.0, but I also tried with 12.2.1100
- .NET Framework 4.6.2, but I've also tried to use ODP.Net Core with .NET Core 3, and had the same problem
- Registry setting
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\FipsAlgorithmPolicy
forEnabled
is set to 0, - I have tried wrapping the username and password in quotes in the connection string, but it still fails.
- If I use the ODP.NET Unmanaged driver, with the exact same connection string (and all other parts identical), I can successfully connect to the Oracle 12c, but the managed driver results in
ORA-01017 - invalid username/password
- As mentioned in other posts, if I try too many times, my account will get locked, so it does hit the DB, but gets rejected.
Most relevant question/answers that I've tried (or been denied the ability to try): Oracle.ManagedDataAccess and ORA-01017: invalid username/password; logon denied
I've tried everything I've found that I am able to try, but I am still unable to get this to work. I REALLY don't want to have the Oracle client as a dependency for my application (it adds an unrealistic amount of documentation and validation for security reasons <insert eyeroll here>).
Edit to address comment below:
I had to severely edit the connection string for security reasons, but it's EZ Connect format. I am not intending to use any oracle client but my laptop does have the Oracle Client (not instant client) installed on it, with ORACLE_HOME
set. I have installed the Oracle.ManagedDataAccess nuget package, as instructed by Oracle's ODP.NET documentation. This code snippet was run in LINQPad (hence the call to .Dump()
). It throws the exception on the call to .Open()
.
I have two projects with the exact same configuration, the only difference being Oracle.DataAccess.Client
vs Oracle.ManagedDataAccess.Client
, with the first one working.
Code used to connect looks like this:
using Oracle.ManagedDataAccess.Client;
void Main()
{
var cs = "USER ID=<userid removed>;DATA SOURCE=<hostname>:1571/<servicename>;PASSWORD=\"<password removed>\"";
using (var conn = new OracleConnection(cs))
{
conn.Open();
conn.GetSchema().Dump();
}
}
The exception thrown is an OracleException
and the message is ORA-01017: invalid username/password; logon denied
. The stack trace looks like this:
at OracleInternal.ConnectionPool.PoolManager`3.Get(ConnectionString csWithDiffOrNewPwd, Boolean bGetForApp, CriteriaCtx criteriaCtx, String affinityInstanceName, Boolean bForceMatch) at OracleInternal.ConnectionPool.OraclePoolManager.Get(ConnectionString csWithNewPassword, Boolean bGetForApp, CriteriaCtx criteriaCtx, String affinityInstanceName, Boolean bForceMatch) at OracleInternal.ConnectionPool.OracleConnectionDispenser`3.Get(ConnectionString cs, PM conPM, ConnectionString pmCS, SecureString securedPassword, SecureString securedProxyPassword, CriteriaCtx criteriaCtx) at Oracle.ManagedDataAccess.Client.OracleConnection.Open() at UserQuery.Main() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()