org.springframework.security.ldap
Class DefaultLdapUsernameToDnMapper

java.lang.Object
  extended by org.springframework.security.ldap.DefaultLdapUsernameToDnMapper
All Implemented Interfaces:
LdapUsernameToDnMapper

public class DefaultLdapUsernameToDnMapper
extends Object
implements LdapUsernameToDnMapper

This implementation appends a name component to the userDnBase context using the usernameAttributeName property. So if the uid attribute is used to store the username, and the base DN is cn=users and we are creating a new user called "sam", then the DN will be uid=sam,cn=users.

Version:
$Id: DefaultLdapUsernameToDnMapper.java 3537 2009-03-19 06:30:32Z ltaylor $
Author:
Luke Taylor

Constructor Summary
DefaultLdapUsernameToDnMapper(String userDnBase, String usernameAttribute)
           
 
Method Summary
 org.springframework.ldap.core.DistinguishedName buildDn(String username)
          Assembles the Distinguished Name that should be used the given username.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultLdapUsernameToDnMapper

public DefaultLdapUsernameToDnMapper(String userDnBase,
                                     String usernameAttribute)
Parameters:
userDnBase - the base name of the DN
usernameAttribute - the attribute to append for the username component.
Method Detail

buildDn

public org.springframework.ldap.core.DistinguishedName buildDn(String username)
Assembles the Distinguished Name that should be used the given username.

Specified by:
buildDn in interface LdapUsernameToDnMapper


Copyright © 2004-2009 SpringSource, Inc. All Rights Reserved.