AuthorizationPolicyBuilder Class

Definition

Used for building policies during application startup.

public ref class AuthorizationPolicyBuilder
public class AuthorizationPolicyBuilder
type AuthorizationPolicyBuilder = class
Public Class AuthorizationPolicyBuilder
Inheritance
AuthorizationPolicyBuilder

Constructors

AuthorizationPolicyBuilder(AuthorizationPolicy)

Creates a new instance of AuthorizationPolicyBuilder.

AuthorizationPolicyBuilder(String[])

Creates a new instance of AuthorizationPolicyBuilder

Properties

AuthenticationSchemes

Gets or sets a list authentication schemes the Requirements are evaluated against.

Requirements

Gets or sets a list of IAuthorizationRequirements which must succeed for this policy to be successful.

Methods

AddAuthenticationSchemes(String[])

Adds the specified authentication schemes to the AuthenticationSchemes for this instance.

AddRequirements(IAuthorizationRequirement[])

Adds the specified requirements to the Requirements for this instance.

Build()

Builds a new AuthorizationPolicy from the requirements in this instance.

Combine(AuthorizationPolicy)

Combines the specified policy into the current instance.

RequireAssertion(Func<AuthorizationHandlerContext,Boolean>)

Adds an AssertionRequirement to the current instance.

RequireAssertion(Func<AuthorizationHandlerContext,Task<Boolean>>)

Adds an AssertionRequirement to the current instance.

RequireAuthenticatedUser()

Adds a DenyAnonymousAuthorizationRequirement to the current instance.

RequireClaim(String)

Adds a ClaimsAuthorizationRequirement to the current instance.

RequireClaim(String, IEnumerable<String>)

Adds a ClaimsAuthorizationRequirement to the current instance.

RequireClaim(String, String[])

Adds a ClaimsAuthorizationRequirement to the current instance.

RequireRole(IEnumerable<String>)

Adds a RolesAuthorizationRequirement to the current instance.

RequireRole(String[])

Adds a RolesAuthorizationRequirement to the current instance.

RequireUserName(String)

Adds a NameAuthorizationRequirement to the current instance.

Applies to