SamlAttribute 构造函数
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
初始化 SamlAttribute 类的新实例。
重载
| 名称 | 说明 |
|---|---|
| SamlAttribute() |
初始化 SamlAttribute 类的新实例。 |
| SamlAttribute(Claim) |
使用指定的声明初始化类的新实例 SamlAttribute 。 |
| SamlAttribute(String, String, IEnumerable<String>) |
使用指定的属性名称、XML 命名空间和属性值初始化类的新实例 SamlAttribute 。 |
SamlAttribute()
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 的属性。
例外
claim 是 null。
注解
使用此构造函数可将声明转换为 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 属性的值。
例外
attributeNamespace 是 null。
-或-
attributeName 是 null。
-或-
attributeValues 是 null。
注解
下表指定由此构造函数的参数设置的属性。
| 财产 | 参数 |
|---|---|
| AttributeValues | attributeValues |
| Name | attributeName |
| Namespace | attributeNamespace |