Condividi tramite


<userNameSecurityTokenHandlerRequirement>

Provides configuration for the MembershipUserNameSecurityTokenHandler class or derived classes.

<configuration>
  <system.identityModel>
    <identityConfiguration>
      <securityTokenHandlers>
        <add>
          <userNameSecurityTokenHandlerRequirement>

Syntax

<system.identityModel>  
  <identityConfiguration>  
    <securityTokenHandlers>  
      <add type="System.IdentityModel.Services.Tokens.MembershipUserNameSecurityTokenHandler, System.IdentityModel.Services">  
        <userNameSecurityTokenHandlerRequirement membershipProviderName=xs:string >  
        </userNameSecurityTokenHandlerRequirement>  
      </add>  
    </securityTokenHandlers>  
  </identityConfiguration>  
</system.identityModel>  

Attributes and Elements

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

Attributes

Attribute Description
membershipProviderName Specifies the MembershipProvider that should be used by the security token handler.

Child Elements

None

Parent Elements

Element Description
<add> Adds the specified security token handler to the token handler collection.

Remarks

The <userNameSecurityTokenHandlerRequirement> element sets the MembershipProvider property when a MembershipUserNameSecurityTokenHandler object is initialized from configuration.

Example

<add type="System.IdentityModel.Services.Tokens.MembershipUserNameSecurityTokenHandler, System.IdentityModel.Services">  
    <userNameSecurityTokenHandlerRequirement membershipProviderName="AspNetSqlProvider/>  
</add>