Edit

Share via


ClaimTypeRequirement.ClaimType Property

Definition

Gets the claim type that was specified in the constructor.

public:
 property System::String ^ ClaimType { System::String ^ get(); };
public string ClaimType { get; }
member this.ClaimType : string
Public ReadOnly Property ClaimType As String

Property Value

The claim type.

Examples

The following code shows how to get this property.

WSFederationHttpBinding binding = new WSFederationHttpBinding();
binding.Security.Message.ClaimTypeRequirements.Add
   (new ClaimTypeRequirement
   ("http://schemas.microsoft.com/ws/2005/05/identity/claims/EmailAddress"));
binding.Security.Message.ClaimTypeRequirements.Add
   (new ClaimTypeRequirement
   ("http://schemas.microsoft.com/ws/2005/05/identity/claims/UserName", true));
ClaimTypeRequirement cr = new ClaimTypeRequirement
   ("http://schemas.microsoft.com/ws/2005/05/identity/claims/UserName", true);
Console.WriteLine(cr.ClaimType);
Console.WriteLine(cr.IsOptional);

Remarks

This property is a URI that defines the type of a claim. For example, to purchase a product from a Web site, the user must present a valid credit card with a sufficient credit limit. The claim type would be the credit card URI.

Applies to