Logon user name is empty

Discussion in 'ASP .Net' started by Alan T, Jul 14, 2010.

  1. Alan T

    Alan T Guest

    ASP.NET 4.0

    I tried to get the Windows Logon user by:

    HttpContext.Current.User.Identity.Name.ToString();

    But it return empty.



    What I want to do is to get the full name of the logon user from Active
    Directory.
     
    Alan T, Jul 14, 2010
    #1
    1. Advertising

  2. Alan T wrote:
    > ASP.NET 4.0
    >
    > I tried to get the Windows Logon user by:
    >
    > HttpContext.Current.User.Identity.Name.ToString();
    >
    > But it return empty.
    >
    > What I want to do is to get the full name of the logon user from Active
    > Directory.
    >


    Are you using authentication before allowing access to the application?
    Or is this a website with anonymous user access, where you happen to be
    logged into Windows on your machine while you are accessing the site,
    thinking the application will know which Windows user you are?
     
    Harlan Messinger, Jul 14, 2010
    #2
    1. Advertising

  3. Alan T

    Alan T Guest

    >> ASP.NET 4.0
    >>
    >> I tried to get the Windows Logon user by:
    >>
    >> HttpContext.Current.User.Identity.Name.ToString();
    >>
    >> But it return empty.
    >>
    >> What I want to do is to get the full name of the logon user from Active
    >> Directory.
    >>

    >
    > Are you using authentication before allowing access to the application? Or
    > is this a website with anonymous user access, where you happen to be
    > logged into Windows on your machine while you are accessing the site,
    > thinking the application will know which Windows user you are?


    Hi,

    At the moment, I am just testing by running within VWD 2010 Express
    (locally) by pressing F5, and the Anonymous access disabled in IIS.

    I can use these to find out my logon user:
    string strName = Request.ServerVariables["LOGON_USER"];


    Response.Write(strName);



    It gives me, for example, that's correct:

    mydomain\smithj
     
    Alan T, Jul 15, 2010
    #3
  4. Alan T

    Harv Guest

    On Jul 14, 5:08 pm, "Alan T" <> wrote:
    > >> ASP.NET 4.0

    >
    > >> I tried to get the Windows Logon user by:

    >
    > >> HttpContext.Current.User.Identity.Name.ToString();

    >
    > >> But it return empty.

    >
    > >> What I want to do is to get the full name of the logon user from Active
    > >> Directory.

    >
    > > Are you using authentication before allowing access to the application? Or
    > > is this a website with anonymous user access, where you happen to be
    > > logged into Windows on your machine while you are accessing the site,
    > > thinking the application will know which Windows user you are?

    >
    > Hi,
    >
    > At the moment, I am just testing by running within VWD 2010 Express
    > (locally) by pressing F5, and the Anonymous access disabled in IIS.
    >
    > I can use these to find out my logon user:
    > string strName = Request.ServerVariables["LOGON_USER"];
    >
    > Response.Write(strName);
    >
    > It gives me, for example, that's correct:
    >
    > mydomain\smithj


    Alan,

    Do you have the Integrated Windows Authentication checked for the site?
     
    Harv, Jul 21, 2010
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. venkat

    Retrieve logon user name from ADSI

    venkat, Nov 6, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    467
    venkat
    Nov 6, 2003
  2. Molly_K
    Replies:
    0
    Views:
    524
    Molly_K
    Aug 10, 2006
  3. Mike
    Replies:
    0
    Views:
    479
  4. pxpilot
    Replies:
    0
    Views:
    458
    pxpilot
    Apr 27, 2008
  5. Kjell Kristiansson
    Replies:
    0
    Views:
    314
    Kjell Kristiansson
    Nov 30, 2005
Loading...

Share This Page