IPrinicipal的MVC表单身份验证和Web API身份验证

问题描述:

亲爱的所有人,



我找到了一个关于MVC表单身份验证的好解决方案,并在应用程序中实现它。

MVC表单身份验证实现可以从以下URL获得



ASP.NET-MVC中的自定义身份验证和授权





虽然已经完成了,现在我也需要WEB API的这个实现。任何人都可以为WEB api提供可能的解决方案



其次我有2个关于此实现的问题。



1.由于用户身份验证是在cookie中维护的,所以如果用户禁用了cookie会怎样?



先谢谢

Dear All,

I found one of nice solution regarding MVC form authentication, and implement it in application.
MVC form authentication implementation can be got from below URL

Custom-Authentication-and-Authorization-in-ASP.NET-MVC


Although its done, Now I need this implementation for WEB API also. Can any one provide possible solution for WEB api

Second I have 2 questions about this implementation.

1. As user authentication is maintained in cookies, so what if cookies are disabled by user?
2. As i see, I logout from application, but still when i navigate back by browser navigation, it still shows previous page, instead to navigate to login/access denied. Although performing some operation on such page, will authenticate and navigate to login page. But still i want if user is logout, then there should no way to navigate back. So what should i do for this.

Thanks in Advance