SamlAttribute Constructors

Definition

Initializes a new instance of the SamlAttribute class.

Overloads

SamlAttribute()

Initializes a new instance of the SamlAttribute class.

SamlAttribute(Claim)

Initializes a new instance of the SamlAttribute class using the specified claim.

SamlAttribute(String, String, IEnumerable<String>)

Initializes a new instance of the SamlAttribute class using the specified attribute name, XML namespace, and attribute values.

SamlAttribute()

Initializes a new instance of the SamlAttribute class.

public SamlAttribute ();

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SamlAttribute(Claim)

Initializes a new instance of the SamlAttribute class using the specified claim.

public SamlAttribute (System.IdentityModel.Claims.Claim claim);

Parameters

claim
Claim

A Claim that represents an attribute of the subject for a SamlSecurityToken security token.

Exceptions

claim is null.

The Resource property of claim is not of type String.

-or-

The Right property of claim is not PossessProperty.

-or-

The ClaimType property of claim does not have a '/' character or it is in the first or last index positions.

Remarks

Use this constructor to convert a claim into a SAML attribute. To be converted to a SAML attribute, the Right property must be PossessProperty, the Resource property must be of type String, and the ClaimType property must be in the format namespace/name.

The following table specifies what the claim parameter sets the Name, Namespace, and the AttributeValues properties to.

Property Property of the claim parameter used to set the property
AttributeValues The value of the Resource property is added to the collection.
Name The portion of the string after the last '/' character in the ClaimType property.
Namespace The portion of the string before the last '/' character in the ClaimType property.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SamlAttribute(String, String, IEnumerable<String>)

Initializes a new instance of the SamlAttribute class using the specified attribute name, XML namespace, and attribute values.

public SamlAttribute (string attributeNamespace, string attributeName, System.Collections.Generic.IEnumerable<string> attributeValues);

Parameters

attributeNamespace
String

The XML namespace in which the attributeName parameter is defined.

attributeName
String

The name of the SAML attribute.

attributeValues
IEnumerable<String>

An IEnumerable<T> that contains the values of the SAML attribute.

Exceptions

attributeNamespace is null.

-or-

attributeName is null.

-or-

attributeValues is null.

The Resource property of claim is not of type String.

-or-

The Right property of claim is not PossessProperty.

-or-

The ClaimType property of claim does not have a '/' character or it is in the first or last index positions.

Remarks

The following table specifies the properties that are set by this constructor's parameters.

Property Parameter
AttributeValues attributeValues
Name attributeName
Namespace attributeNamespace

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1