locked
Retrieving the current AD user username and password RRS feed

  • Question

  • User2033925978 posted

    Hello All,

    I'm working on a legacy .NET application and it has been requested that there is AD authentication put in place.
    As of now the application has it's own table with user info etc. and in order for the user to login the account
    has to be created so it can then be used.

    What I'm trying to accomplish is that a AD user info is authenticated by the application and if it matches account
    created in the application the used is logged in.

    Now for the question, what is the best way to get the current AD user account username and password ?

    PS: By current Ad user I mean the user making the request on the application (it's a ASP.NET app)

    Wednesday, March 28, 2007 10:59 AM

All replies

  • User-2062392830 posted

    1) You aren't going to get the AD password... and who's to say that it's synched with your username/password anyway. The user could easily go in and change his/her AD password at any time... or might be forced to by corporate policy... so that's a no-go from the start!

    2) If you want to be sure to get the AD user account you need to do a couple of things...
    a) Set authentication to be Windows in your web.config
    b) Get the Name property from the CurrentPrinicipal.

    Wednesday, March 28, 2007 7:48 PM