urlauthorization with custom roleprovider
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?
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)
{
}
}
}
精彩评论