Retrieve credentials of a logged in user visual studio 2008 RRS feed

  • Question

  • Hello,

    I work in a company where they asked me to create a site in VS 2008 C# that displays the username of the already Windows logged-in username. It means anyone who opens the link on the server has to see their own username(e.g. Welcome "username") since is already logged in her/his computer.

    When I tried to use  WindowsIdentity.GetCurrent() and some others but actually I retrieve information from the server that is wrong.

    I appreciated your help.



    Wednesday, October 17, 2012 5:55 PM


  • If this is a web application, configure IIS for Windows Authentication.  Then the Windows username is stored in the AUTH_USER server variable coming from the HTTP request:


    But note that the correct forum for ASP.net questions is http://forums.asp.net.

    Jose R. MCP
    Code Samples

    • Proposed as answer by Mike Feng Thursday, October 18, 2012 9:05 AM
    • Marked as answer by Mike Feng Thursday, October 25, 2012 10:54 AM
    Wednesday, October 17, 2012 7:54 PM