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)
Parameters
- claim
- Type: System.IdentityModel.Claims.Claim
A Claim that represents an attribute of the subject for a SamlSecurityToken security token.
| Exception | Condition |
|---|---|
| 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.
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.