C# LDAP身份验证失败。这可能是因为域名的变化吗?

C# LDAP身份验证失败。这可能是因为域名的变化吗?,c#,asp.net,authentication,httpcontext,C#,Asp.net,Authentication,Httpcontext,我可以在域“X”下登录到web应用程序,但最近迁移到了“y”。但是我的VS.NET2003代码没有对域进行任何验证。只要我在数据库注册,它就会接收我。我真的很惊讶它为什么突然停止工作。网络级别的Active directory设置是否会导致任何问题 仅供参考:我使用我的windows登录id(与在数据库中注册的相同)和域密码登录 这是代码 当login.aspx加载时,我调用Authenticate()方法 我在web表单上提供正确的登录凭据。 我已经在web.config中设置了特定于域的值,

我可以在域“X”下登录到web应用程序,但最近迁移到了“y”。但是我的VS.NET2003代码没有对域进行任何验证。只要我在数据库注册,它就会接收我。我真的很惊讶它为什么突然停止工作。网络级别的Active directory设置是否会导致任何问题

仅供参考:我使用我的windows登录id(与在数据库中注册的相同)和域密码登录

这是代码

当login.aspx加载时,我调用Authenticate()方法

我在web表单上提供正确的登录凭据。 我已经在web.config中设置了特定于域的值,但是这些值在这个范围内的任何地方都没有被使用。我希望我能提供更多关于这个问题的细节。但不管我怎么想,这是 我能达到的最大限度

进一步信息:我可以将此错误消息记录到日志文件中

8/14/2012 11:45:06 PM : System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Runtime.InteropServices.COMException (0x8007052E): Logon failure: unknown user name or bad password
   at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
   at System.DirectoryServices.DirectoryEntry.Bind()
   at System.DirectoryServices.DirectoryEntry.get_NativeObject()
   at WorkFlow.WorkFlowLogin.Login()
   at WorkFlow.WorkFlowLogin.LDAPAuthentication(EntityLogin oBELogin, String strURL, String strDomain)
   --- End of inner exception stack trace ---   at Web.Login.LDAPUserAuth()
   at Web.Login.btnLogin_ServerClick(Object sender, EventArgs e) Source = Web Url = http://localhost:8090/Web/WorkFlow/WorkFlowLogin.asmx

我可以看到您的评论指出该方法工作正常,但我打赌“oWFLogin.DBAuthentication”中会出现一些错误。主要是因为a)我在您提供的内容中看不到任何与DirectoryServices相关的代码,b)这是因为域名发生了变化。您能提供DBAuthentication方法中的任何代码吗?特别是与广告相关的代码?感谢您的回复。同时,你能看看我发布的错误日志信息在这里是否有帮助吗?“未知用户名或错误密码”几乎说明了一切。我敢打赌它找不到您指定的用户。可能的原因是,旧域的用户路径仍在使用,并且对您当前使用的域无效,或者您的用户根本不存在于新域中。检查WorkFlow.WorkFlowLogin.ldaAuthentication中正在运行的代码,原因应该相当明显。如果没有,把你发现的贴出来
8/14/2012 11:45:06 PM : System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Runtime.InteropServices.COMException (0x8007052E): Logon failure: unknown user name or bad password
   at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
   at System.DirectoryServices.DirectoryEntry.Bind()
   at System.DirectoryServices.DirectoryEntry.get_NativeObject()
   at WorkFlow.WorkFlowLogin.Login()
   at WorkFlow.WorkFlowLogin.LDAPAuthentication(EntityLogin oBELogin, String strURL, String strDomain)
   --- End of inner exception stack trace ---   at Web.Login.LDAPUserAuth()
   at Web.Login.btnLogin_ServerClick(Object sender, EventArgs e) Source = Web Url = http://localhost:8090/Web/WorkFlow/WorkFlowLogin.asmx