Start protecting the Api
This commit is contained in:
parent
070f41ac7e
commit
57adfc82a5
5 changed files with 11 additions and 4 deletions
|
|
@ -41,11 +41,11 @@ internal class Program
|
|||
services
|
||||
.AddAuthorization(options =>
|
||||
{
|
||||
options.AddPolicy("ApiScope", policy =>
|
||||
options.AddPolicy("BlogScope", policy =>
|
||||
{
|
||||
policy
|
||||
.RequireAuthenticatedUser()
|
||||
.RequireClaim(JwtClaimTypes.Scope, new string[] { "blogs" });
|
||||
.RequireClaim(JwtClaimTypes.Scope, new string[] { "blog" });
|
||||
});
|
||||
})
|
||||
.AddCors(options =>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue