Share via


AuthorizationPolicyBuilder.RequireClaim Method

Definition

Overloads

RequireClaim(String)

Adds a ClaimsAuthorizationRequirement to the current instance which requires that the current user has the specified claim.

RequireClaim(String, IEnumerable<String>)

Adds a ClaimsAuthorizationRequirement 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.

RequireClaim(String, String[])

Adds a ClaimsAuthorizationRequirement 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.

RequireClaim(String)

Source:
AuthorizationPolicyBuilder.cs
Source:
AuthorizationPolicyBuilder.cs
Source:
AuthorizationPolicyBuilder.cs
Source:
AuthorizationPolicyBuilder.cs
Source:
AuthorizationPolicyBuilder.cs
Source:
AuthorizationPolicyBuilder.cs
Source:
AuthorizationPolicyBuilder.cs
Source:
AuthorizationPolicyBuilder.cs
Source:
AuthorizationPolicyBuilder.cs

Adds a ClaimsAuthorizationRequirement to the current instance which requires that the current user has the specified claim.

public:
 Microsoft::AspNetCore::Authorization::AuthorizationPolicyBuilder ^ RequireClaim(System::String ^ claimType);
public Microsoft.AspNetCore.Authorization.AuthorizationPolicyBuilder RequireClaim (string claimType);
member this.RequireClaim : string -> Microsoft.AspNetCore.Authorization.AuthorizationPolicyBuilder
Public Function RequireClaim (claimType As String) As AuthorizationPolicyBuilder

Parameters

claimType
String

The claim type required, with no restrictions on claim value.

Returns

A reference to this instance after the operation has completed.

Applies to

RequireClaim(String, IEnumerable<String>)

Source:
AuthorizationPolicyBuilder.cs
Source:
AuthorizationPolicyBuilder.cs
Source:
AuthorizationPolicyBuilder.cs
Source:
AuthorizationPolicyBuilder.cs
Source:
AuthorizationPolicyBuilder.cs
Source:
AuthorizationPolicyBuilder.cs
Source:
AuthorizationPolicyBuilder.cs
Source:
AuthorizationPolicyBuilder.cs
Source:
AuthorizationPolicyBuilder.cs

Adds a ClaimsAuthorizationRequirement 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:
 Microsoft::AspNetCore::Authorization::AuthorizationPolicyBuilder ^ RequireClaim(System::String ^ claimType, System::Collections::Generic::IEnumerable<System::String ^> ^ requiredValues);
public:
 Microsoft::AspNetCore::Authorization::AuthorizationPolicyBuilder ^ RequireClaim(System::String ^ claimType, System::Collections::Generic::IEnumerable<System::String ^> ^ allowedValues);
public Microsoft.AspNetCore.Authorization.AuthorizationPolicyBuilder RequireClaim (string claimType, System.Collections.Generic.IEnumerable<string> requiredValues);
public Microsoft.AspNetCore.Authorization.AuthorizationPolicyBuilder RequireClaim (string claimType, System.Collections.Generic.IEnumerable<string> allowedValues);
member this.RequireClaim : string * seq<string> -> Microsoft.AspNetCore.Authorization.AuthorizationPolicyBuilder
member this.RequireClaim : string * seq<string> -> Microsoft.AspNetCore.Authorization.AuthorizationPolicyBuilder
Public Function RequireClaim (claimType As String, requiredValues As IEnumerable(Of String)) As AuthorizationPolicyBuilder
Public Function RequireClaim (claimType As String, allowedValues As IEnumerable(Of String)) As AuthorizationPolicyBuilder

Parameters

claimType
String

The claim type required.

requiredValuesallowedValues
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

RequireClaim(String, String[])

Source:
AuthorizationPolicyBuilder.cs
Source:
AuthorizationPolicyBuilder.cs
Source:
AuthorizationPolicyBuilder.cs
Source:
AuthorizationPolicyBuilder.cs
Source:
AuthorizationPolicyBuilder.cs
Source:
AuthorizationPolicyBuilder.cs
Source:
AuthorizationPolicyBuilder.cs
Source:
AuthorizationPolicyBuilder.cs
Source:
AuthorizationPolicyBuilder.cs

Adds a ClaimsAuthorizationRequirement 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:
 Microsoft::AspNetCore::Authorization::AuthorizationPolicyBuilder ^ RequireClaim(System::String ^ claimType, ... cli::array <System::String ^> ^ requiredValues);
public:
 Microsoft::AspNetCore::Authorization::AuthorizationPolicyBuilder ^ RequireClaim(System::String ^ claimType, ... cli::array <System::String ^> ^ allowedValues);
public Microsoft.AspNetCore.Authorization.AuthorizationPolicyBuilder RequireClaim (string claimType, params string[] requiredValues);
public Microsoft.AspNetCore.Authorization.AuthorizationPolicyBuilder RequireClaim (string claimType, params string[] allowedValues);
member this.RequireClaim : string * string[] -> Microsoft.AspNetCore.Authorization.AuthorizationPolicyBuilder
member this.RequireClaim : string * string[] -> Microsoft.AspNetCore.Authorization.AuthorizationPolicyBuilder
Public Function RequireClaim (claimType As String, ParamArray requiredValues As String()) As AuthorizationPolicyBuilder
Public Function RequireClaim (claimType As String, ParamArray allowedValues As String()) As AuthorizationPolicyBuilder

Parameters

claimType
String

The claim type required.

requiredValuesallowedValues
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