0

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?

Muhammad Akhtar
  • 51,913
  • 37
  • 138
  • 191
Nyla Pareska
  • 1,377
  • 6
  • 22
  • 37

1 Answers1

1

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
  • 51,913
  • 37
  • 138
  • 191
  • 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 Oct 19 '09 at 12:37