Partager via


<userNameAuthentication>

Specifies a service's credentials based on user name and password.

<system.serviceModel>

  <behaviors>

    <serviceBehaviors>

      <behavior> of <serviceBehaviors>

        <serviceCredentials> Element

          <userNameAuthentication>

                                    
                                    <userNameAuthentication
                                
                                    
                                       cacheLogonTokenLifetime="TimeSpan"
                                
                                    
                                       cacheLogonTokens="Boolean" 
                                
                                    
                                       customUserNamePasswordValidatorType="String"
                                
                                    
                                       includeWindowsGroups="Boolean" 
                                
                                    
                                       maxCacheLogonTokens="Integer"
                                
                                    
                                       membershipProviderName="String"
                                
                                    
                                       userNamePasswordValidationMode="Windows/MembershipProvider/Custom" />
                                

Attributes and Elements

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

Attributes

Attribute Description

cacheLogonTokenLifetime

A Timespan that specifies the maximum length of time a token is cached. The default is 00:15:00.

cacheLogonTokens

A Boolean value that specifies whether logon tokens are cached. The default is false.

customUserNamePasswordValidatorType

A string that specifies the type of custom username password validator to be used. The default is an empty string.

includeWindowsGroups

A Boolean value that specifies whether Windows groups are included in the security context. The default is true.

Setting this attribute to true has a performance impact as it results in a full-group expansion. Set this property to false if you do not need to establish the list of groups a user belongs to.

maxCacheLogonTokens

An integer that specifies the maximum number of logon tokens to cache. This value should be larger than zero. The default is 128.

membershipProviderName

When the clientCredentialType attribute of a binding is set to username, the username is mapped to Windows accounts. You can override this behavior using this attribute, which is a string that contains the name of the MembershipProvider value that provides the relevant password validation mechanism.

userNamePasswordValidationMode

Specifies the manner in which username password is validated. Valid values are:

  • Windows

  • MembershipProvider

  • Custom

The default is Windows. This attribute is of type UserNamePasswordValidationMode.

Child Elements

None.

Parent Elements

Element Description

<serviceCredentials> Element

Specifies the credential to be used in authenticating the service, and the client credential validation related settings.

See Also

Reference

UserNameServiceElement

Footer image

Send comments about this topic to Microsoft.
© Microsoft Corporation. All rights reserved.