Partilhar via


PolicyBuilderExtensions.RequireScope Method

Definition

Overloads

RequireScope(AuthorizationPolicyBuilder, IEnumerable<String>)

Adds a ScopeAuthorizationRequirement to the current instance which requires that the current user has the specified claim and that the claim value must be one of the allowed values.

RequireScope(AuthorizationPolicyBuilder, String[])

Adds a ScopeAuthorizationRequirement to the current instance which requires that the current user has the specified claim and that the claim value must be one of the allowed values.

RequireScope(AuthorizationPolicyBuilder, IEnumerable<String>)

Adds a ScopeAuthorizationRequirement to the current instance which requires that the current user has the specified claim and that the claim value must be one of the allowed values.

public static Microsoft.AspNetCore.Authorization.AuthorizationPolicyBuilder RequireScope (this Microsoft.AspNetCore.Authorization.AuthorizationPolicyBuilder authorizationPolicyBuilder, System.Collections.Generic.IEnumerable<string> allowedValues);
static member RequireScope : Microsoft.AspNetCore.Authorization.AuthorizationPolicyBuilder * seq<string> -> Microsoft.AspNetCore.Authorization.AuthorizationPolicyBuilder
<Extension()>
Public Function RequireScope (authorizationPolicyBuilder As AuthorizationPolicyBuilder, allowedValues As IEnumerable(Of String)) As AuthorizationPolicyBuilder

Parameters

authorizationPolicyBuilder
AuthorizationPolicyBuilder

Used for building policies during application startup.

allowedValues
IEnumerable<String>

Values the claim must process one or more of for evaluation to succeed.

Returns

A reference to this instance after the operation has completed.

Applies to

RequireScope(AuthorizationPolicyBuilder, String[])

Adds a ScopeAuthorizationRequirement to the current instance which requires that the current user has the specified claim and that the claim value must be one of the allowed values.

public static Microsoft.AspNetCore.Authorization.AuthorizationPolicyBuilder RequireScope (this Microsoft.AspNetCore.Authorization.AuthorizationPolicyBuilder authorizationPolicyBuilder, params string[] allowedValues);
static member RequireScope : Microsoft.AspNetCore.Authorization.AuthorizationPolicyBuilder * string[] -> Microsoft.AspNetCore.Authorization.AuthorizationPolicyBuilder
<Extension()>
Public Function RequireScope (authorizationPolicyBuilder As AuthorizationPolicyBuilder, ParamArray allowedValues As String()) As AuthorizationPolicyBuilder

Parameters

authorizationPolicyBuilder
AuthorizationPolicyBuilder

Used for building policies during application startup.

allowedValues
String[]

Values the claim must process one or more of for evaluation to succeed.

Returns

A reference to this instance after the operation has completed.

Applies to