Skip to content

Provide an example using AuthorizationPolicyBuilder  #34469

@tdykstra

Description

@tdykstra

Description

UUF verbatim

It would be really useful to see an example of the below. Git repo doesn't have it either."The AuthorizationPolicyBuilder should either be constructed with at least one authorization scheme name or always succeed. Otherwise there is no information on how to provide a challenge to the user and an exception will be thrown.Adding requirements to the policy based on the age with AuthorizationPolicyBuilder.AddRequirements. In other scenarios, you might use RequireClaim, RequireRole, or RequireUserName instead."

Page URL

https://learn.microsoft.com/en-us/aspnet/core/security/authorization/iauthorizationpolicyprovider?view=aspnetcore-9.0

Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/security/authorization/iauthorizationpolicyprovider.md

Document ID

7b5c3832-a5a3-a27a-eed3-3ecfc3e8dbe2

Article author

@mjrousos

Metadata

  • ID: 150023ea-e35a-4a06-6f71-7ab63994b07f
  • Service: aspnet-core
  • Sub-service: security

Related Issues

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions