0

I use LDAP for authenticating users to my website (DirectoryEntry,DirectorySearcher). so my users enter their active directory user and password for entering to webpage. Now I want to add windows authentication capability to my website too. I used <authentication mode="Windows"/> in web.config file and configured IIS, but when I Open the website, browser logging page is appeared but I want to show my favorite logging page and user just selects window authentication and enter login button to logging to website.

How to authenticate a windows authentication user in code behind?

Raymond Morphy
  • 2,464
  • 9
  • 51
  • 93
  • why is it impossible? For example sql server uses windows authentication. – Raymond Morphy Feb 10 '14 at 12:29
  • You can build layer for communication with AD. Check this: http://www.codeproject.com/Articles/37558/Windows-Authentication-Using-Form-Authentication – Andrei Feb 10 '14 at 12:31
  • Ok, so, not impossible but quite painful. – Andrei Feb 10 '14 at 12:32
  • Windows auth is passive, so the user should be logged in when it is enabled. One strategy is to have windows auth as primary and forms auth (with the ldap) as a fallback. See [this SO question](http://stackoverflow.com/q/2250921/580951). – Dustin Kingen Feb 10 '14 at 12:33
  • My problem is entering user password.I don't want to user enters it's password in my website. it is authenticated with windows before – Raymond Morphy Feb 10 '14 at 12:35

0 Answers0