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


Type: System.IdentityModel.Claims.Claim

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

Exception Condition

claim is null.


The Resource property of claim is not of type String.


The Right property of claim is not PossessProperty.


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 of the claim parameter used to set the property


The value of the Resource property is added to the collection.


The portion of the string after the last '/' character in the ClaimType property.


The portion of the string before the last '/' character in the ClaimType property.

.NET Framework
Available since 3.0
Return to top