Can someone shw me the way to actually integrate a Windows Login Form with Active Directory so that I can use the user credentials from AD when a user tries to login to an application.
Thanks,
Anand
Loading
Can someone shw me the way to actually integrate a Windows Login Form with Active Directory so that I can use the user credentials from AD when a user tries to login to an application.
Thanks,
Anand
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
pradeepPosted Apr 6, 2006, 2:59 AM
I want to use userid/password authentication in one of my windows applications.
I am not using any SQL, Oracle db but want to use XML file (or db) for storing passwords.
But want it to encrypt/decrypt in that file.
Could you please help me which direction i should proceed as I am not aware with encypt/decrypt utilty VS.Net has.
Regards,
Pradeep
dkode8Posted Mar 8, 2006, 9:20 AM
I have created a couple of applications using AD Authentication and then create a encrypted cookie with logon credentials. I would show you the code, but I am using it in a number of organizations and don't want to show the source code.
Look in the System.DirectoryServices namespace.
The way I did it, was I made a class that handles all the tasks of getting user information from AD and processing the login. It then passes this information to another class that handles assigning the cookie etc...
Basically what you need to do, is when they supply username/password you need to use DirectorySearcher to find the object in ad that matches their username, if not found, i display an error. If the searcher did find the username, then I bind to that object getting its information and check the supplied password against the ad objects password property. If all goes well, I send the username over to the other class to assign the cookie and finish the login.
Eventually I made a Server Control that has a generic login form and processing routines behind the scenes. This way I could re-use the control on as many asp.net websites as I needed.
Hope that helps you! Trial and error makes a good programmer :)