views:

64

answers:

1

I am interacting with a third party httpmodule for authentication. I implemented my custom roleprovider to interact with that. However they use a CustomPrincipal instead of the expected RolePrincipal for urlauthorization.

In which event in global.asax can I hook to grab the customprincipal, instantiate a new RolePrincipal and copy over the custom Identity implementation they provide?

+1  A: 

you need to use Application_AuthenticateRequest event

protected void Application_AuthenticateRequest(object sender, EventArgs e)
{
    if (HttpContext.Current.User != null)
    {
        if (HttpContext.Current.User.Identity.IsAuthenticated)
        { 
        }
    }
}
Muhammad Akhtar
Thank you. I will try that. At the moment I believe it is in the PostAuthenticaterequest where they set the principal. I guess I need to ask them to change this event to AuthenticateRequest then.
Nyla Pareska