Best Practice for Checking if user is logged into application

Discussion in 'ASP .Net' started by =?Utf-8?B?TWlrZSBNb29yZQ==?=, Jun 21, 2005.

  1. Does anyone have suggestions on the best way to check if a user is logged
    into asp.net web application?

    We are not using forms authentication. We are authenticating our users
    against active directory. I some people use the database to determine if a
    user is logged in between web pages and check in the web forms.
     
    =?Utf-8?B?TWlrZSBNb29yZQ==?=, Jun 21, 2005
    #1
    1. Advertising

  2. When you say 'against active directory' .... is that Windows Authentication?

    You can use the User.Identity class to obtain certain information about the
    currently logged in user:

    User.Identity.IsAuthenticated = [True|False]
    User.Identity.Name = [<username>]
    User.Identity.AuthenticationType = [Forms|Windows...]

    You can setup forms authentication to authenticate against Active Directory,
    which is my preferred method, because you can have a much more integrated and
    themed login page (as opposed to Windows/Integrated authentication) and still
    get AD-based credential authentication. Check out this link:

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetHT02.asp

    I've got a working version in VB.NET to post if you're not working in C#.

    Andrew A. Willett
    Tech Xero


    "Mike Moore" wrote:

    > Does anyone have suggestions on the best way to check if a user is logged
    > into asp.net web application?
    >
    > We are not using forms authentication. We are authenticating our users
    > against active directory. I some people use the database to determine if a
    > user is logged in between web pages and check in the web forms.
     
    =?Utf-8?B?QW5kcmV3IFdpbGxldHQ=?=, Jun 22, 2005
    #2
    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. keithb
    Replies:
    0
    Views:
    641
    keithb
    Feb 16, 2006
  2. Chumma Dede
    Replies:
    4
    Views:
    1,172
  3. Replies:
    1
    Views:
    956
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Apr 12, 2007
  4. Astra

    Best way to monitor a logged in user

    Astra, May 19, 2004, in forum: ASP General
    Replies:
    0
    Views:
    86
    Astra
    May 19, 2004
  5. Patient Guy

    Best Coding Practice? Argument Checking

    Patient Guy, Aug 7, 2006, in forum: Javascript
    Replies:
    0
    Views:
    145
    Patient Guy
    Aug 7, 2006
Loading...

Share This Page