0

I could login to a web application when i was under the domain "X" but recently migrated to "y". But my VS.Net 2003 code doesn't do anything to verify the domain. As long as i'm registered with the database, it takes me in. I'm really surprised why it stopped working all of a sudden. Could there be anything due to Active directory setting at the network level?

FYI: I use my windows login id (the same registered in the database) and domain password to login.

Here is the code.

When login.aspx loads, i call Authenticate() method

            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
                }
            }

I'm supplying proper login credentials on the web form. I've set domain specific values in web.config but those are not being used anywhere in this scope. I wish i should give more details about the problem. But however i think, this is the maximum i could get to.

Further information: I could record this error message to the log file.

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
CodeMad
  • 950
  • 2
  • 12
  • 30
  • I can see that your comments state that the method works fine, but I would be betting on something going wrong in "oWFLogin.DBAuthentication". Mainly because a) I can't see any DirectoryServices related code in what you have provided and b) it's since a domain name change. Could you provide any code from the DBAuthentication method? specifically AD related code? – Darren Reid Aug 14 '12 at 23:45
  • Thanks for the response. In the mean time, can you please see whether the error log information i posted is of any help here? – CodeMad Aug 15 '12 at 17:34
  • "unknown user name or bad password" pretty much says it all. I would bet that it can't find the user you are specifying. Possible reason is have a user path for the old domain is still being used and is not valid for the domain you are now using or that you user simply doesn't exist on the new domain. Check the code being run in WorkFlow.WorkFlowLogin.LDAPAuthentication and the reason should be fairly obvious. If not, post up what you find – Darren Reid Aug 16 '12 at 01:28

0 Answers0