MVC 5 External authentication with authentication mode=Forms

前端 未结 2 1412
我在风中等你
我在风中等你 2021-02-05 21:48

I\'m following this tutorial to create a simple MVC 5 app with external authentication. It\'s working fine, but, if I change the authentication mode=\"None\" to

2条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-05 22:34

    Usually, you would set authentication mode="None", when users are not authenticated at all or if you plan to develop custom authentication code. MVC 5 has been updated to use ASP.NET Identity for authentication.

    ASP.NET Identity supports claims-based authentication, where the user’s identity is represented as a set of claims. Here, you set authentication mode="Forms" , Claims will not work, because ASP.NET Forms Authentication does not support claims. That's why you get a null value.

提交回复
热议问题