Reputation: 11348
Seemingly duplicate question, but it wasnt answered in detail. Well at least i dont believe it was.
Who sets the IsAuthenticated property of the HttpContext.User.Identity
The answer was
FormsAuthentication.SetAuthCookie
But I decompiled System.Web.Security FormsAuthenication Class. It Calls GetAuthCookie and adds it to the response.
Im Expecting its on the next request when the Session Cookie is found and not in FormsAuthentication as stated as "correct answer". I searched the full decompiled source and didnt find a refernce to IPrincipal. Does some really know ? Can I trigger this process with and Event.? I notice events such as
AuthenticateRequest
and AuthorizeRequest
Upvotes: 1
Views: 967
Reputation: 9052
It's being set in event AuthenticateRequest
, see FormsAuthenticationModule.OnEnter
which is bound to AuthenticateRequest
by FormsAuthenticationModule.Init
. If want to override this identity, you can simply set HttpContext.User
by yourself.
Upvotes: 1