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.
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.
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. :ehh:
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.
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.
Re: User.Identity.Name and Forms Authentication
Sounds good, add [Resolved] now? Unless you have more questions.