Re: When exactly Application_AuthenticateRequest event is fired?
- From: Dominick Baier [DevelopMentor] <dbaier@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 24 Dec 2005 01:27:05 -0800
hi,
AuthenticateRequest gets fired on each request -
if you want to add code there to get roles for the user do something like this:
if (Context.Request.IsAuthenticated)
{// get roles
// create GenericPrincipal // set Context.User
}
after you call SetAuthCookie you need another roundtrip for this event to fire - e.g. a redirect to your main page etc...
--------------------------------------- Dominick Baier - DevelopMentor http://www.leastprivilege.com
Hello, friends,
In our forms authentication asp.net app, I used FormsAuthentication.SetAuthCookie() to authenticate a new registered user like the follows:
//...already create a new userID from our DB FormsAuthentication.SetAuthCookie(Request.Form["loginName"], true); Then I planned in Application_AuthenticateRequest() to assign roles to this new user using GenericPrincipal().
However, although I set breakpoint, it did not stop. I thought that calling FormsAuthentication.SetAuthCookie() would trigger Application_AuthenticateRequest() event.
So, at exactly what condition, an Application_AuthenticateRequest event will be fired?
Thanks a lot.
.
- Follow-Ups:
- Prev by Date: Foms Authentication questions
- Next by Date: Re: When exactly Application_AuthenticateRequest event is fired?
- Previous by thread: Foms Authentication questions
- Next by thread: Re: When exactly Application_AuthenticateRequest event is fired?
- Index(es):
Relevant Pages
|