Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ClaimTypeRequirement Class

Specifies the types of required and optional claims expected to appear in the federated credential.

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

public class ClaimTypeRequirement
public class ClaimTypeRequirement
public class ClaimTypeRequirement
Not applicable.

In a federated scenario, services state the requirements on incoming credentials. For example, the incoming credentials must possess a certain set of claim types. This requirement is manifested in a security policy. When a client requests a security token from a security token service (for example, "InfoCard"), it puts the requirements into a token request so that the security token service can issue the security token that satisfies the requirements accordingly.

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

The following config file is used with the preceding code.

<bindings>
  <wsFederationHttpBinding>
    <binding name="myFederatedBinding">
      <security mode="Message">
        <message issuedTokenType="urn:oasis:names:tc:SAML:1.0:assertion">
          <claimTypeRequirements>
            <add claimType="http://schemas.microsoft.com/ws/2005/05/identity/claims/EmailAddress"
              isOptional="false" />
            <add claimType="http://schemas.microsoft.com/ws/2005/05/identity/claims/UserName"
              isOptional="true" />
          </claimTypeRequirements>
        </message>
      </security>
    </binding>
  </wsFederationHttpBinding>
</bindings>

System.Object
  System.ServiceModel.Security.Tokens.ClaimTypeRequirement

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2015 Microsoft