Skip to content

Instantly share code, notes, and snippets.

@mattbajorek
Last active May 10, 2020 02:09
Show Gist options
  • Save mattbajorek/ff2f51d558685156e41df0333cd359d7 to your computer and use it in GitHub Desktop.
Save mattbajorek/ff2f51d558685156e41df0333cd359d7 to your computer and use it in GitHub Desktop.
Add Policy Based Authorization
...
public void ConfigureServices(IServiceCollection services)
{
...
services
.AddAuthorization(options =>
{
options.AddPolicy("Admin", policy => policy.RequireClaim("custom:groupId", new List<string> { "0" } ));
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment