Start protecting the Api

This commit is contained in:
Paul Schneider 2026-06-06 21:30:41 +01:00
commit 57adfc82a5
5 changed files with 11 additions and 4 deletions

View file

@ -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 =>