Oracle.ManagedDataAccess and ORA-01017: invalid username/password; logon denied

后端 未结 9 913
青春惊慌失措
青春惊慌失措 2020-12-01 13:11

I have a challenging situation on one of our servers. I have an ASP.NET MVC 3 application that needs to connect to an Oracle 12c database. It does so using the following co

相关标签:
9条回答
  • 2020-12-01 13:29

    I had exactly same issue. When I was connecting to database directly from SqlDeveloper, it was working fine. But my application ( built on VB6) failed to connect to Oracle and giving error "ORA-01017 Invalid ID/password.
    After turning off, case sensitive login for my database ID, it resolved the issue.

    0 讨论(0)
  • 2020-12-01 13:32

    I had the same issue using Entity Framework and the Oracle.ManagedDataAccess.Client, but I had some success by uppercasing my password in the configuration connection string section.

    0 讨论(0)
  • 2020-12-01 13:33

    I did not quite have the same scenario as this case does, but I did have very similar results. What I did to sort out the problem was, I enclosed the password in quotes like the following (VB.NET):

    cnx.ConnectionString = "User ID=MYID;Password=""MyPass"" ;Data Source=MyTEST"

    or use chr(34) as follows

    cnx.ConnectionString = "User ID=MYID;Password="+chr(34)+"MyPass"+chr(34)+" ;Data Source=MyTEST"
    
    0 讨论(0)
  • 2020-12-01 13:35

    For some reason (and have no idea why ) my c# code sends my username uppercased even though I write it as lowercase.

    For example my username is kullaniciadi you may think uppercase of this would be KULLANICIADI but seems it's not. My server's locale is Turkish (I believe this is the reason) so uppercased version of my username becomes KULLANİCİADİ because in Turkish uppercase of i is İ and uppercase of ı is I. And this results invalid username error.

    Had no control over database so can't change any settings on it.

    Typing my username all uppercased solved the problem.

    Also this only works in combination of accepted answer. If registry key mentioned in accepted answer is set to 1 then this answer may not work.

    Spent lots of hours for this stupid thing. I'm writing this down so you won't.

    0 讨论(0)
  • 2020-12-01 13:37

    I have been struggling with this same issue for a couple of weeks and finally have a resolution. I had to disable the FIPS security policy, try setting this key:

    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\FipsAlgorithmPolicy] "Enabled"=dword:00000000

    to zero, it worked perfectly for me

    I was following your thread your blank password issue eventually pointed me here:

    https://community.oracle.com/thread/2557592?start=30&tstart=0

    0 讨论(0)
  • 2020-12-01 13:38

    Based on Jeff's answer (10/31/2014)...

    The registry setting can be set by GPO to only allow FIPS compliant algorithms. Setting this to 0 as indicated may be a violation of some security policies and get overwritten by the GPO. This registry setting controls more than just IIS or ASP.NET.

    There is another way that is specific to .NET and may work at the application level. This is much easier to justify compared to modifying the settings of the whole server.

    Application specific method:

    In your Web.config or App.config file, add the following setting:

    <configuration> <!-- Will already be there -->
      <runtime>
        <enforceFIPSPolicy enabled="false"/>
      </runtime>
    ...  the rest of your .config
    

    If I remember correctly, this must be at the beginning of your config file.

    All .NET application method:

    Place the setting above in the machine.config file. There will be one for each .NET version and architecture (64 bit/32 bit). There will already be a element, so put the element inside it.

    0 讨论(0)
提交回复
热议问题