M
Mike Green
Hi
I am creating a ASP.NET 2 applications with Forms Authentication with Active
Directory Login page.
I have created a login page, web.config file etc. exactly like the examples
in the MSDN article:-
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/paght000026.asp
Apart from one thing it all works ok.
I can log in with the correct username and password etc. no problem. If I
enter an incorrect username, it displays a message "Your login attempt was
not successful. Please try again.", which is expected.
However, if I enter a correct Username but Incorrect Password, I get a
server error (like below).
I have tried everything, but can't seem to get this to work.
Any ideas or thoughts would be much appreciated?
Many Thanks
Mike Green
Server Error in '/FormsAuthAD' Application.
----------------------------------------------------------------------------
----
A local error occurred.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.DirectoryServices.Protocols.LdapException: A local
error occurred.
Source Error:
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.
Stack Trace:
[LdapException: A local error occurred.]
System.DirectoryServices.Protocols.LdapConnection.BindHelper(NetworkCredenti
al newCredential, Boolean needSetCredential) +2050
System.DirectoryServices.Protocols.LdapConnection.Bind(NetworkCredential
newCredential) +30
System.Web.Security.ActiveDirectoryMembershipProvider.ValidateCredentials(St
ring username, String password) +364
System.Web.Security.ActiveDirectoryMembershipProvider.ValidateUserCore(Strin
g username, String password) +1556
System.Web.Security.ActiveDirectoryMembershipProvider.ValidateUser(String
username, String password) +34
System.Web.UI.WebControls.Login.AuthenticateUsingMembershipProvider(Authenti
cateEventArgs e) +100
System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e)
+113
System.Web.UI.WebControls.Login.AttemptLogin() +178
System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e)
+134
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +56
System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +107
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
+178
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePo
stBackEvent(String eventArgument) +31
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +32
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +72
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3837
I am creating a ASP.NET 2 applications with Forms Authentication with Active
Directory Login page.
I have created a login page, web.config file etc. exactly like the examples
in the MSDN article:-
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/paght000026.asp
Apart from one thing it all works ok.
I can log in with the correct username and password etc. no problem. If I
enter an incorrect username, it displays a message "Your login attempt was
not successful. Please try again.", which is expected.
However, if I enter a correct Username but Incorrect Password, I get a
server error (like below).
I have tried everything, but can't seem to get this to work.
Any ideas or thoughts would be much appreciated?
Many Thanks
Mike Green
Server Error in '/FormsAuthAD' Application.
----------------------------------------------------------------------------
----
A local error occurred.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.DirectoryServices.Protocols.LdapException: A local
error occurred.
Source Error:
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.
Stack Trace:
[LdapException: A local error occurred.]
System.DirectoryServices.Protocols.LdapConnection.BindHelper(NetworkCredenti
al newCredential, Boolean needSetCredential) +2050
System.DirectoryServices.Protocols.LdapConnection.Bind(NetworkCredential
newCredential) +30
System.Web.Security.ActiveDirectoryMembershipProvider.ValidateCredentials(St
ring username, String password) +364
System.Web.Security.ActiveDirectoryMembershipProvider.ValidateUserCore(Strin
g username, String password) +1556
System.Web.Security.ActiveDirectoryMembershipProvider.ValidateUser(String
username, String password) +34
System.Web.UI.WebControls.Login.AuthenticateUsingMembershipProvider(Authenti
cateEventArgs e) +100
System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e)
+113
System.Web.UI.WebControls.Login.AttemptLogin() +178
System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e)
+134
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +56
System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +107
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
+178
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePo
stBackEvent(String eventArgument) +31
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +32
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +72
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3837