ASP.NET Core 传统授权的基本配置

1、使用中间件

  - app.UseAuthentication();  //鉴权 鉴定验证权限

  - app.UseAuthorization():  //授权 验证通过则授权

2、配置授权过程

  

3、授权生效

  [AuthorizeAttribute]

  public IActionResult Index()

  {

    return View();

  }

 

posted @ 2022-02-09 21:59  BeReallyMe  阅读(82)  评论(0)    收藏  举报