Last active
May 10, 2020 02:09
-
-
Save mattbajorek/ff2f51d558685156e41df0333cd359d7 to your computer and use it in GitHub Desktop.
Add Policy Based Authorization
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
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