通过


SamlAttribute 构造函数

定义

初始化 SamlAttribute 类的新实例。

重载

名称 说明
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

Claim 个表示安全令牌使用者 SamlSecurityToken 的属性。

例外

claimnull

属性Resourceclaim的类型不是 String

-或-

Right属性claim不是 PossessProperty

-或-

claim属性ClaimType没有“/”字符,或者它位于第一个或最后一个索引位置。

注解

使用此构造函数可将声明转换为 SAML 属性。 要转换为 SAML 属性,该Right属性必须是ResourcePossessProperty类型,ClaimType并且属性String必须采用格式namespace/name

下表指定参数设置NameNamespace的内容claim以及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 属性的值。

例外

attributeNamespacenull

-或-

attributeNamenull

-或-

attributeValuesnull

属性Resourceclaim的类型不是 String

-或-

Right属性claim不是 PossessProperty

-或-

claim属性ClaimType没有“/”字符,或者它位于第一个或最后一个索引位置。

注解

下表指定由此构造函数的参数设置的属性。

财产 参数
AttributeValues attributeValues
Name attributeName
Namespace attributeNamespace

适用于