0

当我在域“X”下但最近迁移到“y”时,我可以登录到 Web 应用程序。但是我的 VS.Net 2003 代码没有做任何事情来验证域。只要我在数据库中注册,它就会带我进入。我真的很惊讶它为什么突然停止工作。由于网络级别的活动目录设置,可能有什么问题吗?

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

这是代码。

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

            private void Authenticate()
            {
                try
                {
                    oBELogin = new EntityLogin(); //Property

                    oBELogin.UserId = Context.User.Identity.Name.Split('\\')[1].ToString(); //Here i used to get "domain name\login id".
                    dsLogin = (DataSet)oWFLogin.DBAuthentication(oBELogin,"Y"); //This is a web service call for authentication.  From there Database layer -> Stored procedure call.  Everything happens fine

                    if(dsLogin.Tables[0].Rows.Count>0)
                    {
                       //Code for session that works.                       
                        Response.Redirect("Page2.htm",false);
                    }
                }
                catch(System.Threading.ThreadAbortException excep) {}
                catch(System.IndexOutOfRangeException exOutOfRange)
                {
                  //Write IndexOutOfRangeException
                }

                catch(Exception ex)
                {
                  //LDAP error
                }
            }

我在 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
4

0 回答 0