policy-based authorization

Protecting endpoints with named policies that bundle requirements, such as a scope claim and a role.

In more detail

options.AddPolicy("catalog.write", p => p.RequireClaim("scope", "catalog.write")) defines one; RequireAuthorization("catalog.write") applies it. Keep policy names central so routes cannot misspell a permission.

Related terms

Taught in

References