get current user information

Discussion in 'ASP .Net' started by =?Utf-8?B?QmFydA==?=, Nov 26, 2004.

  1. I want to get the current username (or other information) about the user who
    is currently logged on in the windows 2000 domain.
    I thought about user.identity.name, but it returns an empty string.
    Any suggestions ?
    =?Utf-8?B?QmFydA==?=, Nov 26, 2004
    #1
    1. Advertising

  2. >I want to get the current username (or other information) about the user
    >who
    > is currently logged on in the windows 2000 domain.
    > I thought about user.identity.name, but it returns an empty string.
    > Any suggestions ?

    You must deny all unauthenticated users by adding a
    <deny users="?" /> element to the authorization element in your web.config
    file.

    Anders Norås
    http://dotnetjunkies.com/weblog/anoras/
    Anders Norås [MCAD], Nov 26, 2004
    #2
    1. Advertising

  3. Hi,

    I suppose you are talking about ASP .NET apps and Integrated Windows
    authentication. Open the Virtual Dir for the project in IIS, Right Click ->
    Properties -> Directory Security Tab -> Click Edit -> Uncheck the Anonymous
    access check box.

    HTH
    Regards
    Joyjit

    "Bart" <> wrote in message
    news:...
    > I want to get the current username (or other information) about the user

    who
    > is currently logged on in the windows 2000 domain.
    > I thought about user.identity.name, but it returns an empty string.
    > Any suggestions ?
    Joyjit Mukherjee, Nov 26, 2004
    #3
  4. ...and you must ensure that Integrated Windows Authentication is enabled for
    the virtual directory on IIS.

    Anders Norås
    http://dotnetjunkies.com/weblog/anoras/
    "Anders Norås [MCAD]" <> wrote in message
    news:...
    > >I want to get the current username (or other information) about the user
    > >who
    >> is currently logged on in the windows 2000 domain.
    >> I thought about user.identity.name, but it returns an empty string.
    >> Any suggestions ?

    > You must deny all unauthenticated users by adding a
    > <deny users="?" /> element to the authorization element in your web.config
    > file.
    >
    > Anders Norås
    > http://dotnetjunkies.com/weblog/anoras/
    >
    Anders Norås [MCAD], Nov 26, 2004
    #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. Mike Newton
    Replies:
    0
    Views:
    2,872
    Mike Newton
    Jul 23, 2004
  2. Steve C. Orr [MVP, MCSD]
    Replies:
    0
    Views:
    1,597
    Steve C. Orr [MVP, MCSD]
    Jul 23, 2004
  3. nalbayo
    Replies:
    2
    Views:
    5,478
    Bruce Barker
    Nov 11, 2005
  4. YiMkiE
    Replies:
    14
    Views:
    549
    Dann Corbit
    Jul 7, 2006
  5. Shaminda Illangantilaka

    How can I get the current logged user information

    Shaminda Illangantilaka, Jan 4, 2006, in forum: ASP .Net Security
    Replies:
    2
    Views:
    146
    Patrick.O.Ige
    Jan 25, 2006
Loading...

Share This Page