spring-security-ldap

org.springframework.security.ldap.userdetails
Interface UserDetailsContextMapper

All Known Implementing Classes:
InetOrgPersonContextMapper, LdapUserDetailsMapper, PersonContextMapper

public interface UserDetailsContextMapper

Operations to map a UserDetails object to and from a Spring LDAP DirContextOperations implementation. Used by LdapUserDetailsManager when loading and saving/creating user information, and also by the LdapAuthenticationProvider to allow customization of the user data loaded during authentication.

Since:
2.0
Author:
Luke Taylor

Method Summary
 org.springframework.security.core.userdetails.UserDetails mapUserFromContext(DirContextOperations ctx, String username, Collection<org.springframework.security.core.GrantedAuthority> authority)
          Creates a fully populated UserDetails object for use by the security framework.
 void mapUserToContext(org.springframework.security.core.userdetails.UserDetails user, DirContextAdapter ctx)
          Reverse of the above operation.
 

Method Detail

mapUserFromContext

org.springframework.security.core.userdetails.UserDetails mapUserFromContext(DirContextOperations ctx,
                                                                             String username,
                                                                             Collection<org.springframework.security.core.GrantedAuthority> authority)
Creates a fully populated UserDetails object for use by the security framework.

Parameters:
ctx - the context object which contains the user information.
username - the user's supplied login name.
authority - the list of authorities which the user should be given.
Returns:
the user object.

mapUserToContext

void mapUserToContext(org.springframework.security.core.userdetails.UserDetails user,
                      DirContextAdapter ctx)
Reverse of the above operation. Populates a context object from the supplied user object. Called when saving a user, for example.


spring-security-ldap