User information in the web request

Discussion in 'ASP .Net' started by Vadym Stetsyak, May 13, 2005.

  1. Hi there!
    Is it possible to retieve user nt name from the web request? This question
    arose while thinking about authentication system implementation in the
    asp.net.

    I want to make authentication process transparent for the user. E.g. if the
    user is logged on the domain or is a member of the domain then perform
    authentication autimatically - as a result user won't experience any login
    windows, otherwise web-app will provide the form similar the IIS one for
    authentication.

    Can this be done from the web application?

    TIA
    --
    Vadym Stetsyak
     
    Vadym Stetsyak, May 13, 2005
    #1
    1. Advertising

  2. You can tell who the user is once they are logged into the app, but you will
    get IUSR_ComputerName or NetworkSystem prior to this point, as web apps are
    anon by default.

    There are ways to set up IE on an Intranet to avoid the login. An even
    better option is issuing user certs, as the user can work from any computer
    he has a cert without having to worry about login.


    ---

    Gregory A. Beamer
    MVP; MCP: +I, SE, SD, DBA

    ***************************
    Think Outside the Box!
    ***************************

    "Vadym Stetsyak" wrote:

    > Hi there!
    > Is it possible to retieve user nt name from the web request? This question
    > arose while thinking about authentication system implementation in the
    > asp.net.
    >
    > I want to make authentication process transparent for the user. E.g. if the
    > user is logged on the domain or is a member of the domain then perform
    > authentication autimatically - as a result user won't experience any login
    > windows, otherwise web-app will provide the form similar the IIS one for
    > authentication.
    >
    > Can this be done from the web application?
    >
    > TIA
    > --
    > Vadym Stetsyak
    >
    >
    >
     
    =?Utf-8?B?Q293Ym95IChHcmVnb3J5IEEuIEJlYW1lcikgLSBN, May 13, 2005
    #2
    1. Advertising

  3. Thanks for the answer, I know about these ways, just wondered if it can be
    completed in the other way

    "Cowboy (Gregory A. Beamer) - MVP" <> wrote
    in message news:...
    > You can tell who the user is once they are logged into the app, but you

    will
    > get IUSR_ComputerName or NetworkSystem prior to this point, as web apps

    are
    > anon by default.
    >
    > There are ways to set up IE on an Intranet to avoid the login. An even
    > better option is issuing user certs, as the user can work from any

    computer
    > he has a cert without having to worry about login.
    >
    >
    > ---
    >
    > Gregory A. Beamer
    > MVP; MCP: +I, SE, SD, DBA
    >
    > ***************************
    > Think Outside the Box!
    > ***************************
    >
    > "Vadym Stetsyak" wrote:
    >
    > > Hi there!
    > > Is it possible to retieve user nt name from the web request? This

    question
    > > arose while thinking about authentication system implementation in the
    > > asp.net.
    > >
    > > I want to make authentication process transparent for the user. E.g. if

    the
    > > user is logged on the domain or is a member of the domain then perform
    > > authentication autimatically - as a result user won't experience any

    login
    > > windows, otherwise web-app will provide the form similar the IIS one for
    > > authentication.
    > >
    > > Can this be done from the web application?
    > >
    > > TIA
    > > --
    > > Vadym Stetsyak
    > >
    > >
    > >
     
    Vadym Stetsyak, May 13, 2005
    #3
  4. Hi Vadym,

    If you use windows authentication and deny anonymous access:
    In web.config
    <authentication mode="Windows" />
    <authorization>
    <deny users="?" />
    <allow users="*" />
    </authorization>

    Then you can use
    Context.User.Identity.Name

    to get Domain/userID.

    And use

    Context.User.IsInRole(strRole)

    to perform role checking.

    HTH

    Elton Wang






    "Vadym Stetsyak" wrote:

    > Hi there!
    > Is it possible to retieve user nt name from the web request? This question
    > arose while thinking about authentication system implementation in the
    > asp.net.
    >
    > I want to make authentication process transparent for the user. E.g. if the
    > user is logged on the domain or is a member of the domain then perform
    > authentication autimatically - as a result user won't experience any login
    > windows, otherwise web-app will provide the form similar the IIS one for
    > authentication.
    >
    > Can this be done from the web application?
    >
    > TIA
    > --
    > Vadym Stetsyak
    >
    >
    >
     
    =?Utf-8?B?RWx0b24gVw==?=, May 13, 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. Brian Birtle
    Replies:
    2
    Views:
    2,055
    John Saunders
    Oct 16, 2003
  2. z. f.
    Replies:
    0
    Views:
    686
    z. f.
    Feb 3, 2005
  3. subrato
    Replies:
    8
    Views:
    920
    Juan T. Llibre
    Mar 14, 2006
  4. clercmedia
    Replies:
    2
    Views:
    32,316
    clercmedia
    Dec 9, 2005
  5. lerenard001
    Replies:
    0
    Views:
    426
    lerenard001
    Jul 7, 2008
Loading...

Share This Page