Results 1 to 5 of 5

Thread: User.Identity.Name and Forms Authentication

  1. #1

    Thread Starter
    Lively Member nmaccari's Avatar
    Join Date
    Mar 2002
    Posts
    67

    Question User.Identity.Name and Forms Authentication

    I noticed that if you are using Forms Authentication then you can't pull the User.Identity.Name. It is empty. In our applications we need to use Forms Auth. but still at times I need to retrieve the user and the error when they can't sign in.

    Is there a way to pull the User's Name from their computer even though I am using Forms Authentication in the Web Config file?

    Thanks.
    Nick

  2. #2
    Frenzied Member brin351's Avatar
    Join Date
    Mar 2007
    Location
    Land Down Under
    Posts
    1,293

    Re: User.Identity.Name and Forms Authentication

    In short no, if they have not logged in user.identity has not even been created. You could set a perminant cookie when they do login and see if it's there on a future failed attempt, either the formsAuth cookie or a generic one.

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: User.Identity.Name and Forms Authentication

    It's logical, isn't it? If they can't sign in, you won't have a User.Identity.Name.

    When their attempt to login fails though, they will have entered their username+password in textboxes at some point. You have that information. Use that information to log the exception.

  4. #4

    Thread Starter
    Lively Member nmaccari's Avatar
    Join Date
    Mar 2002
    Posts
    67

    Re: User.Identity.Name and Forms Authentication

    Ok. Thanks. I was afraid of that. I won't worry about it. The login page is a stand alone website that I don't have access to.
    Nick

  5. #5
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: User.Identity.Name and Forms Authentication

    Sounds good, add [Resolved] now? Unless you have more questions.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width