Compartir a través de


<nameClaimType>

Sets the claim type that specifies the Name property. The claim type is used to search for a Claim in the collection of ClaimsIdentity objects returned by the ValidateToken method of this token handler. The value of the matching claim is then set as the name of the IIdentity generated from this token handler.

<configuration>
  <system.identityModel>
    <identityConfiguration>
      <securityTokenHandlers>
        <add>
          <samlSecurityTokenRequirement>
            <nameClaimType>

Syntax

<system.identityModel>  
  <identityConfiguration>  
    <securityTokenHandlers>  
      <add>  
        <samlSecurityTokenRequirement>  
          <nameClaimType value=xs:string>  
          </nameClaimType>  
        </samlSecurityTokenRequirement>  
      </add>  
    </securityTokenHandlers>  
  </identityConfiguration>  
</system.identityModel>  

Attributes and Elements

The following sections describe attributes, child elements, and parent elements.

Attributes

Attribute Description
value A string that specifies the URI that represents the claim type of the claim to use for the Name property. Required.

Child Elements

None

Parent Elements

Element Description
<samlSecurityTokenRequirement> Provides configuration for the SamlSecurityTokenHandler class, the Saml2SecurityTokenHandler class, or a derived class of either of these classes.

Remarks

The <nameClaimType> element sets the NameClaimType property when a SamlSecurityTokenRequirement object is initialized from configuration.

Example

<add type="System.IdentityModel.Tokens.SamlSecurityTokenHandler, System.IdentityModel">  
    <samlSecurityTokenRequirement>  
        <nameClaimType value="https://schemas.xmlsoap.org/ws/2005/05/identity/claims/name" />  
    </samlSecurityTokenRequirement>  
</add>  

See also