title: Oracle.ManagedDataAccess.Client.OracleException: ORA-01017: invalid username/password; logon denied
body: <p>I'm experiencing an issue by using ODP.NET version 19.3 (latest Oracle Managed DataAccess available) to connect to Oracle 11g using a Secure External Password Store (SEPS), where the Oracle login credentials are stored in a client-side Oracle wallet. </p>
  
  <p>If I switch to a classic login/password connection string, there are no problems with database connection and commands.</p>
  
  <p>Furthermore, I report that all other .net applications that are using classic ODP 11 (un-managed DataAccess) have no problems to connect in SEPS mode; in fact, I'm building the first case of using ODP.NET 19.3 with SEPS and Oracle wallet mode.</p>
  
  <p>In order I have:</p>
  
  <ol>
  <li><p>created a wallet (with mkstore utils) for our application and put it in a directory of server: ie </p>
  
  <blockquote>
    <p>C:\users\%APP_POOL_ID%\wallet</p>
  </blockquote></li>
  <li><p>created (for all applications) a sqlnet.ora file and put it in Oracle Home directory of server: ie </p>
  
  <blockquote>
    <p>%ORACLE_HOME%\Network\Admin </p>
  </blockquote></li>
  </ol>
  
  <p>with the following content:</p>
  
  <pre><code>SQLNET.AUTHENTICATION_SERVICES=(NTS)
  NAMES.DIRECTORY_PATH=(TNSNAMES,LDAP,EZCONNECT,HOSTNAME)
  names.ldap_conn_timeout = 1
  WALLET_LOCATION=(SOURCE=(METHOD=FILE)(METHOD_DATA=(DIRECTORY=c:\users\%APP_POOL_ID%\wallet)))
  SQLNET.WALLET_OVERRIDE = TRUE
  DIAG_ADR_ENABLED = off
  </code></pre>
  
  <ol start="3">
  <li><p>using the following ConnectionString:</p>
  
  <pre><code>Data Source=DS_NAME_1; User ID=[USER_ID_1];Proxy User Id=[USER_ID_1];
  </code></pre></li>
  </ol>
  
  <p><em>Note: User ID and Proxy User Id are specified with square brackets inside connection string.</em></p>
  
  <p>This is the exception with stack trace we obtain:</p>
  
  <blockquote>
    <p><strong>Oracle.ManagedDataAccess.Client.OracleException: ORA-01017: invalid username/password; logon denied</strong> </p>
    
    <p>at OracleInternal.ConnectionPool.PoolManager`3.Get(ConnectionString csWithDiffOrNewPwd, Boolean bGetForApp, OracleConnection connRefForCriteria, String affinityInstanceName, Boolean bForceMatch) </p>
    
    <p>at OracleInternal.ConnectionPool.OraclePoolManager.Get(ConnectionString csWithNewPassword, Boolean bGetForApp, OracleConnection connRefForCriteria, String affinityInstanceName, Boolean bForceMatch) </p>
    
    <p>at OracleInternal.ConnectionPool.OracleConnectionDispenser`3.Get(ConnectionString cs, PM conPM, ConnectionString pmCS, SecureString securedPassword, SecureString securedProxyPassword, OracleConnection connRefForCriteria) </p>
    
    <p>at Oracle.ManagedDataAccess.Client.OracleConnection.Open()</p>
  </blockquote>
  
  <p>and this is a portion of the trace I obtain enabling by <code>&lt;oracle.manageddataaccess.client&gt;</code> config section:</p>
  
  <pre><code>&gt;[...]
  &gt;(PRI) (TUN) OracleTuningAgent::Unegister(): Unegistered pool Data Source=DS_NAME_1; User ID=;Proxy User Id=[USER_ID_1];
  &gt;[...]
  </code></pre>
  
  <p>Additionally, in another trace file, it's possible to see the <strong>WriteOAuthMessage passes BLANK password</strong> to DB:</p>
  
  <pre><code>&gt;(PRI) (TTC) (EXT) TTCAuthenticate.ReadOSessKeyResponse()
  &gt;(PRI) (SVC) (ENT) OracleConnectionImpl.CheckForAnyErrorFromDB()
  &gt;(PRI) (SVC) (EXT) OracleConnectionImpl.CheckForAnyErrorFromDB()
  &gt;(PRI) (TTC) (ENT) TTCAuthenticate.WriteOAuthMessage()
  &gt;(PRI) (TTC) (ENT) TTCAuthenticate.WriteOAuthMessage()
  &gt;(PRI) (TTC) (ENT) TTCFunction.WriteFunctionHeader()
  &gt;(PRI) (TTC) (ENT) TTCMessage.WriteTTCCode()
  &gt;(PRI) (TTC) (EXT) TTCMessage.WriteTTCCode()
  &gt;(PRI) (TTC) (EXT) TTCFunction.WriteFunctionHeader()
  &gt;(PRI) (TTC) (EXT) TTCAuthenticate.WriteOAuthMessage()
  &gt;(PRI) (TTC) (EXT) TTCAuthenticate.WriteOAuthMessage()
  &gt;(NET) (SND) 00 00 03 80 06 00 00 00   |........|
  &gt;(NET) (SND) 00 00                     |..      |
  &gt;(NET) (SND) 03 73 00 01 01 06 02 01   |.s......|
  &gt;[..user removed..]
  &gt;(NET) (SND) 41 55 54 48 5F 50 41 53   |AUTH_PAS|
  &gt;(NET) (SND) 53 57 4F 52 44 01 40 40   |SWORD.@@|
  &gt;(NET) (SND) 00 00 00 00 00 00 00 00   |........|
  &gt;(NET) (SND) 00 00 00 00 00 00 00 00   |........|
  &gt;(NET) (SND) 00 00 00 00 00 00 00 00   |........|
  &gt;(NET) (SND) 00 00 00 00 00 00 00 00   |........|
  &gt;(NET) (SND) 00 00 00 00 00 00 00 00   |........|
  &gt;(NET) (SND) 00 00 00 00 00 00 00 00   |........|
  &gt;(NET) (SND) 00 00 00 00 00 00 00 00   |........|
  &gt;(NET) (SND) 00 00 00 00 00 00 00 00   |........|
  </code></pre>
  
  <p>I excluded the problem is a really wrong login/password by logging in the server machine with user credentials and test connection to the database via sqlplus command.</p>
  
  <p>Can anyone help me?</p>
  
  <p>Many thanks!</p>