HttpContext.Current.User.Identity.Name & ServerVariable("LOGON_USE

Discussion in 'ASP .Net Security' started by Barry, Oct 26, 2005.

  1. Barry

    Barry Guest

    I have an Intranet application that uses the
    System.Web.HttpContext.Current.User.Identity.Name to grab the DOMAIN\USERNAME
    of the current user.

    SCENARIO:
    The user logs into their machine with their id/password and authenicates
    against the domain. Fine. That works. However, when this user surfs to my
    Intranet application the Current.User.Identity.Name returns a different
    USERNAME than what was logged into the machine with.

    While troubleshooting this issue, I found that when using the
    SERVERVARIABLE("LOGON_USER") to get the DOMAIN\USERNAME, the correct USERNAME
    is returned.

    Does anybody have an idea as to why the two would produce different results?

    Thanks in advance.
    Barry
    Barry, Oct 26, 2005
    #1
    1. Advertising

  2. Hello Barry,

    who is logged on - and what does it return?

    ---------------------------------------
    Dominick Baier - DevelopMentor
    http://www.leastprivilege.com

    > I have an Intranet application that uses the
    > System.Web.HttpContext.Current.User.Identity.Name to grab the
    > DOMAIN\USERNAME of the current user.
    >
    > SCENARIO:
    > The user logs into their machine with their id/password and
    > authenicates
    > against the domain. Fine. That works. However, when this user surfs
    > to my
    > Intranet application the Current.User.Identity.Name returns a
    > different
    > USERNAME than what was logged into the machine with.
    > While troubleshooting this issue, I found that when using the
    > SERVERVARIABLE("LOGON_USER") to get the DOMAIN\USERNAME, the correct
    > USERNAME is returned.
    >
    > Does anybody have an idea as to why the two would produce different
    > results?
    >
    > Thanks in advance. Barry
    >
    Dominick Baier [DevelopMentor], Oct 26, 2005
    #2
    1. Advertising

  3. Barry

    Barry Guest

    Re: HttpContext.Current.User.Identity.Name & ServerVariable("LOGON

    The user (Non-Admin) logs onto their machine with, as an example, ID TT1234.
    However, the Current.User.Identity.Name returns TP1234.

    If I use the ServerVariable("LOGON_USER") the correct ID, TT1234, is
    returned.

    This only happens for this one particular user.



    "Dominick Baier [DevelopMentor]" wrote:

    > Hello Barry,
    >
    > who is logged on - and what does it return?
    >
    > ---------------------------------------
    > Dominick Baier - DevelopMentor
    > http://www.leastprivilege.com
    >
    > > I have an Intranet application that uses the
    > > System.Web.HttpContext.Current.User.Identity.Name to grab the
    > > DOMAIN\USERNAME of the current user.
    > >
    > > SCENARIO:
    > > The user logs into their machine with their id/password and
    > > authenicates
    > > against the domain. Fine. That works. However, when this user surfs
    > > to my
    > > Intranet application the Current.User.Identity.Name returns a
    > > different
    > > USERNAME than what was logged into the machine with.
    > > While troubleshooting this issue, I found that when using the
    > > SERVERVARIABLE("LOGON_USER") to get the DOMAIN\USERNAME, the correct
    > > USERNAME is returned.
    > >
    > > Does anybody have an idea as to why the two would produce different
    > > results?
    > >
    > > Thanks in advance. Barry
    > >

    >
    >
    >
    Barry, Oct 26, 2005
    #3
  4. Re: HttpContext.Current.User.Identity.Name & ServerVariable("LOGON

    Have you tried using User.Identity.Name?
    Are you in a Active Directory environment?
    Patrick


    "Barry" <> wrote in message
    news:...
    > The user (Non-Admin) logs onto their machine with, as an example, ID

    TT1234.
    > However, the Current.User.Identity.Name returns TP1234.
    >
    > If I use the ServerVariable("LOGON_USER") the correct ID, TT1234, is
    > returned.
    >
    > This only happens for this one particular user.
    >
    >
    >
    > "Dominick Baier [DevelopMentor]" wrote:
    >
    > > Hello Barry,
    > >
    > > who is logged on - and what does it return?
    > >
    > > ---------------------------------------
    > > Dominick Baier - DevelopMentor
    > > http://www.leastprivilege.com
    > >
    > > > I have an Intranet application that uses the
    > > > System.Web.HttpContext.Current.User.Identity.Name to grab the
    > > > DOMAIN\USERNAME of the current user.
    > > >
    > > > SCENARIO:
    > > > The user logs into their machine with their id/password and
    > > > authenicates
    > > > against the domain. Fine. That works. However, when this user surfs
    > > > to my
    > > > Intranet application the Current.User.Identity.Name returns a
    > > > different
    > > > USERNAME than what was logged into the machine with.
    > > > While troubleshooting this issue, I found that when using the
    > > > SERVERVARIABLE("LOGON_USER") to get the DOMAIN\USERNAME, the correct
    > > > USERNAME is returned.
    > > >
    > > > Does anybody have an idea as to why the two would produce different
    > > > results?
    > > >
    > > > Thanks in advance. Barry
    > > >

    > >
    > >
    > >
    Patrick.O.Ige, Oct 31, 2005
    #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. Giovanni Bassi
    Replies:
    0
    Views:
    638
    Giovanni Bassi
    Oct 20, 2003
  2. Dan Bart
    Replies:
    4
    Views:
    27,807
    Andrea D'Onofrio [MSFT]
    Dec 18, 2003
  3. Replies:
    10
    Views:
    3,472
    Kiran_S_Rao
    Dec 8, 2004
  4. =?Utf-8?B?dnZlbms=?=

    Help with HttpContext.Current.User.Identity.Name

    =?Utf-8?B?dnZlbms=?=, Sep 29, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    633
    Brock Allen
    Sep 29, 2005
  5. nalbayo
    Replies:
    2
    Views:
    5,491
    Bruce Barker
    Nov 11, 2005
Loading...

Share This Page