This topic has not yet been rated - Rate this topic

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.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.