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[]
宣告必須處理一或多個 值,評估才能成功。
傳回
完成作業之後,這個執行個體的參考。