ASP.NET Core 2.1 Identity: Role-based authorization -> Access Denied

后端 未结 2 1777
天涯浪人
天涯浪人 2020-12-10 07:27

I\'m using ASP.NET Core 2.1 with the new Identity framwork from .NET. The regular Authorization attribute works as long as no role specific role is requested.

2条回答
  •  感情败类
    2020-12-10 08:09

    Hmmm. I have the following code in an Asp.Net 2.1 project that is working:

    services.AddDefaultIdentity()
             .AddRoles()
             //.AddDefaultUI(UIFramework.Bootstrap4)
             .AddDefaultTokenProviders()
             .AddEntityFrameworkStores();
    

提交回复
热议问题