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
User contributions licensed under CC BY-SA 3.0