How to get network user name with FORMS authentication

Discussion in 'ASP .Net' started by Don, Jun 10, 2005.

  1. Don

    Don Guest

    I'm using FROMS authentication and want to automate the login.

    Right now I force the user to manually log in. I would like to detect
    the users network userName and if they have an account I will
    automatically log them in. If they don't they wil be taken to the
    login page.

    I can get the network id of the user using System.Environment.UserName
    if I turn off anonymous access but this gived me an access denied
    error. If I turn on anonymous access I can get the the page but the
    userName I get is the IUsr account.

    How can I get the network user id?

    Don
     
    Don, Jun 10, 2005
    #1
    1. Advertising

  2. Turn off anonymous access, use Integrated Windows Authenication, and use the
    PageUser.Identity.Name to get the login name.

    "Don" <>
    ???????:...
    > I'm using FROMS authentication and want to automate the login.
    >
    > Right now I force the user to manually log in. I would like to detect
    > the users network userName and if they have an account I will
    > automatically log them in. If they don't they wil be taken to the
    > login page.
    >
    > I can get the network id of the user using System.Environment.UserName
    > if I turn off anonymous access but this gived me an access denied
    > error. If I turn on anonymous access I can get the the page but the
    > userName I get is the IUsr account.
    >
    > How can I get the network user id?
    >
    > Don
    >
     
    Lau Lei Cheong, Jun 13, 2005
    #2
    1. Advertising

  3. Don

    Don Guest

    When I try this I get an exception when I try to redirect to another
    page. The exception message is 'Thread was being aborted".

    I turned off allow anonymous access and set authentication
    mode='Windows".
     
    Don, Jun 13, 2005
    #3
  4. Don

    Don Guest

    This is what I'm trying to accomplish:
    I have an application called MasterSite that is used to authenticate
    users for all of our applications. Since we may have users that are
    not on our Domain each application needs to use FORMS authentication
    and the login URL is a page in this MasterSite application. This login
    page validates the suer against a table in the database.
    This works fine, the users are redirected to the login page in the
    MasterSite application, the FormsAuthentication Cookie is added to the
    response, and the response if redirected to the calling application.

    I then wanted to add the abiliy for our Domain users to seemlessly
    login. I added a column to the user table that holds a users network
    login name. I can then look up a user in page_load and if that network
    login name existis I can log them in as that user and redirect back to
    the calling application. If the network name does nto exist I continue
    process the page and they get the login prompt.
    Users on our domain who be automatically logged it but user not on the
    Domain could still manually login.
     
    Don, Jun 13, 2005
    #4
  5. Don

    hp2

    Joined:
    Jul 24, 2007
    Messages:
    1
    got it working?

    Did you get it working? If so, how. I want to do something similair; both anonoymous and network automatically flow in.
     
    hp2, Jul 24, 2007
    #5
    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. Eric
    Replies:
    2
    Views:
    1,542
    Tommy
    Feb 13, 2004
  2. ashish

    Forms Authentication User Name

    ashish, Aug 15, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    10,854
    ashish
    Aug 15, 2006
  3. Mufasa
    Replies:
    4
    Views:
    347
    Mufasa
    May 1, 2007
  4. Eric
    Replies:
    2
    Views:
    605
  5. Replies:
    0
    Views:
    133
Loading...

Share This Page