CarterCommunity / Carter

Carter is framework that is a thin layer of extension methods and functionality over ASP.NET Core allowing code to be more explicit and most importantly more enjoyable.
MIT License
2.06k stars 174 forks source link

Example on how to use role based identity in unit-tests #239

Closed danielmoncada closed 1 year ago

danielmoncada commented 4 years ago

Hello,

Current set of unit-tests for security appear to be around claims. Would like to see a sample surrounding 'role' based identification.

Current policy is set up as (with my UTs returning a 500 unauthorized)

      services.AddAuthorization(options =>
      {
           options.AddPolicy("LoggedIn", policy => policy.RequireRole(loggedInRoles));
      });
jchannon commented 1 year ago

Not really a direct Carter concern