語言

SamlAttribute 建構函式

定義

初始化 SamlAttribute 類別的新執行個體。

多載

名稱 Description
SamlAttribute()

初始化 SamlAttribute 類別的新執行個體。

SamlAttribute(Claim)

使用指定的聲明初始化該 SamlAttribute 類別的新實例。

SamlAttribute(String, String, IEnumerable<String>)

使用指定的屬性名稱、XML 命名空間及屬性值初始化該類別的新實例 SamlAttribute 。

SamlAttribute()

初始化 SamlAttribute 類別的新執行個體。

public:
 SamlAttribute();
public SamlAttribute();
Public Sub New ()

適用於

SamlAttribute(Claim)

使用指定的聲明初始化該 SamlAttribute 類別的新實例。

public:
 SamlAttribute(System::IdentityModel::Claims::Claim ^ claim);
public SamlAttribute(System.IdentityModel.Claims.Claim claim);
new System.IdentityModel.Tokens.SamlAttribute : System.IdentityModel.Claims.Claim -> System.IdentityModel.Tokens.SamlAttribute
Public Sub New (claim As Claim)

參數

claim
Claim

A Claim 代表安全權杖主體 SamlSecurityToken 的屬性。

例外狀況

claim 是 null。

Resource的claim性質 不屬於類型 String。

-或-

Right的claim性質不是PossessProperty。

-或-

ClaimType屬性claim的屬性沒有 '/' 字元,或位於索引的第一或最後一個位置。

備註

使用此建構子將理賠轉換成 SAML 屬性。 要轉換成 SAML 屬性, Right 屬性必須是 PossessProperty,屬性 Resource 必須型別 String為 ,且 ClaimType 格式為 namespace/name。

下表說明參數將 、 、 claim 及屬性設定Name為何Namespace。 AttributeValues

房產 用於設定屬性的參數性質claim
AttributeValues 財產價值 Resource 會被加到該收藏中。
Name 屬性中最後一個 '/' 字元 ClaimType 之後的字串部分。
Namespace 屬性中字串中最後一個 '/' 字元 ClaimType 之前的部分。

適用於

SamlAttribute(String, String, IEnumerable<String>)

使用指定的屬性名稱、XML 命名空間及屬性值初始化該類別的新實例 SamlAttribute 。

public:
 SamlAttribute(System::String ^ attributeNamespace, System::String ^ attributeName, System::Collections::Generic::IEnumerable<System::String ^> ^ attributeValues);
public SamlAttribute(string attributeNamespace, string attributeName, System.Collections.Generic.IEnumerable<string> attributeValues);
new System.IdentityModel.Tokens.SamlAttribute : string * string * seq<string> -> System.IdentityModel.Tokens.SamlAttribute
Public Sub New (attributeNamespace As String, attributeName As String, attributeValues As IEnumerable(Of String))

參數

attributeNamespace
String

定義參數的 attributeName XML 命名空間。

attributeName
String

SAML 屬性的名稱。

attributeValues
IEnumerable<String>

一個 IEnumerable<T> 包含 SAML 屬性值的 。

例外狀況

attributeNamespace 是 null。

-或-

attributeName 是 null。

-或-

attributeValues 是 null。

Resource的claim性質 不屬於類型 String。

-或-

Right的claim性質不是PossessProperty。

-或-

ClaimType屬性claim的屬性沒有 '/' 字元,或位於索引的第一或最後一個位置。

備註

下表指定了由此建構子參數所設定的屬性。

房產 參數
AttributeValues attributeValues
Name attributeName
Namespace attributeNamespace

適用於