【发布时间】:2020-03-24 02:20:57
【问题描述】:
以下代码是我在 Asp.Net Core 3 中的操作方法。
[HttpGet]
[Authorize]
public async Task<IActionResult> Info()
{
if (!User.Identity.IsAuthenticated) /// Is this need?
{
return BadRequest("Un Authorized Access");
}
}
我在方法上使用了Authorize 属性。我需要用User.Identity.IsAuthenticated 再次检查用户的身份验证吗?
【问题讨论】:
标签: asp.net asp.net-core .net-core authorization asp.net-identity