AuthorizationPolicyBuilder.RequireClaim 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
RequireClaim(String) |
ClaimsAuthorizationRequirement将 添加到当前 实例,该实例要求当前用户具有指定的声明。 |
RequireClaim(String, IEnumerable<String>) |
ClaimsAuthorizationRequirement将 添加到当前 实例,该实例要求当前用户具有指定的声明,并且声明值必须是允许的值之一。 |
RequireClaim(String, String[]) |
ClaimsAuthorizationRequirement将 添加到当前 实例,该实例要求当前用户具有指定的声明,并且声明值必须是允许的值之一。 |
RequireClaim(String)
ClaimsAuthorizationRequirement将 添加到当前 实例,该实例要求当前用户具有指定的声明。
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
参数
- claimType
- String
声明类型是必需的,对声明值没有限制。
返回
完成操作后对此实例的引用。
适用于
RequireClaim(String, IEnumerable<String>)
ClaimsAuthorizationRequirement将 添加到当前 实例,该实例要求当前用户具有指定的声明,并且声明值必须是允许的值之一。
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
参数
- claimType
- String
所需的声明类型。
- requiredValuesallowedValues
- IEnumerable<String>
声明必须处理的一个或多个 的值才能使评估成功。
返回
完成操作后对此实例的引用。
适用于
RequireClaim(String, String[])
ClaimsAuthorizationRequirement将 添加到当前 实例,该实例要求当前用户具有指定的声明,并且声明值必须是允许的值之一。
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
参数
- claimType
- String
所需的声明类型。
- requiredValuesallowedValues
- String[]
声明必须处理的一个或多个 的值才能使评估成功。
返回
完成操作后对此实例的引用。