Export (0) Print
Expand All

ClaimTypeRequirement Constructor (String)

Initializes a new instance of the ClaimTypeRequirement class for a required claim of the specified type.

Namespace:  System.ServiceModel.Security.Tokens
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

public ClaimTypeRequirement(
	string claimType
)

Parameters

claimType
Type: System.String

The claim type.

The predefined claim types can be found at ClaimTypes.

The following code adds two claim type requirements to a security binding.

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));

.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