开发者

urlauthorization with custom roleprovider

开发者 https://www.devze.com 2022-12-08 17:04 出处:网络
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 expect

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)
        { 
        }
    }
}
0

精彩评论

暂无评论...
验证码 换一张
取 消