I am using windows authentication for log in to websites.when we enter wrong password it is again showing the same log in dialogue .I want to alert user as wrong username/password.Please help me how to achieve this

1 Answer 1


I don't think you can actually accomplish this using windows authentication.

For the user name portion, if you think about it for a moment, how would you actually know they entered the "wrong" user name? If I enter domain\jsmith but I intended to enter domain\jsmithe, both could actually be valid users.

For both the user name and password, the active directory domain controller(s) (which is what actually authenticates the user name/password combination) will basically only tell you that the credentials didn't authenticate - not the specific reason.

On a side note, even if the domain controller did tell you that the password was incorrect for the given user name, I would strongly discourage you from presenting that to the user as it can be used for malicious intent. Most commercial sites will not tell you if the password is incorrect for exactly this reason.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.