Export (0) Print
Expand All

SamlAttribute Constructor (Claim)

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

Namespace:  System.IdentityModel.Tokens
Assembly:  System.IdentityModel (in System.IdentityModel.dll)

public SamlAttribute(
	Claim claim
)

Parameters

claim
Type: System.IdentityModel.Claims.Claim

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

ExceptionCondition
ArgumentNullException

claim is null.

ArgumentException

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.

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.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft