Proper way to authenticate a Windows user RRS feed

  • Question

  • Folks,

    In our .NET application, the user specifies username and password from a login dialog. The username could be one from the local machine (eg., mylocalbox\peter) or from the active directory (eg., mydomain\peter). Our application just needs to ensure that the password is valid.

    I have seen an example of using LDAP. However, this may work only for AD account but not for local acount.

    I have also seen another suggestion of calling LogonAsUser using Win32 interop.

    I am wondering if someone can suggest a proper way to handle Windows user authentication. Sample code would be appreciated.

    Thank you in advance for your help.


    Wednesday, November 5, 2008 6:19 PM


  • Thank you all for your help. I ended up using LogonUser using interop. It serves our purpose well.

    This is a web-based application.

    • Marked as answer by Peter Taps Friday, November 7, 2008 9:40 PM
    Friday, November 7, 2008 9:40 PM

All replies