|
Spring Security Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.security.userdetails.ldap.LdapUserDetailsMapper
public class LdapUserDetailsMapper
The context mapper used by the LDAP authentication provider to create an LDAP user object.
Constructor Summary | |
---|---|
LdapUserDetailsMapper()
|
Method Summary | |
---|---|
protected GrantedAuthority |
createAuthority(Object role)
Creates a GrantedAuthority from a role attribute. |
protected String |
mapPassword(Object passwordValue)
Extension point to allow customized creation of the user's password from the attribute stored in the directory. |
UserDetails |
mapUserFromContext(org.springframework.ldap.core.DirContextOperations ctx,
String username,
GrantedAuthority[] authorities)
Creates a fully populated UserDetails object for use by the security framework. |
void |
mapUserToContext(UserDetails user,
org.springframework.ldap.core.DirContextAdapter ctx)
Reverse of the above operation. |
void |
setConvertToUpperCase(boolean convertToUpperCase)
Determines whether role field values will be converted to upper case when loaded. |
void |
setPasswordAttributeName(String passwordAttributeName)
The name of the attribute which contains the user's password. |
void |
setRoleAttributes(String[] roleAttributes)
The names of any attributes in the user's entry which represent application roles. |
void |
setRolePrefix(String rolePrefix)
The prefix that should be applied to the role names |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LdapUserDetailsMapper()
Method Detail |
---|
public UserDetails mapUserFromContext(org.springframework.ldap.core.DirContextOperations ctx, String username, GrantedAuthority[] authorities)
UserDetailsContextMapper
mapUserFromContext
in interface UserDetailsContextMapper
ctx
- the context object which contains the user information.username
- the user's supplied login name.authorities
- the list of authorities which the user should be given.
public void mapUserToContext(UserDetails user, org.springframework.ldap.core.DirContextAdapter ctx)
UserDetailsContextMapper
mapUserToContext
in interface UserDetailsContextMapper
protected String mapPassword(Object passwordValue)
passwordValue
- the value of the password attribute
protected GrantedAuthority createAuthority(Object role)
The default implementation converts string attributes to roles, making use of the rolePrefix and convertToUpperCase properties. Non-String attributes are ignored.
role
- the attribute returned from
public void setConvertToUpperCase(boolean convertToUpperCase)
convertToUpperCase
- true if the roles should be converted to upper case.public void setPasswordAttributeName(String passwordAttributeName)
passwordAttributeName
- the name of the attributepublic void setRoleAttributes(String[] roleAttributes)
roleAttributes
- the names of the role attributes.public void setRolePrefix(String rolePrefix)
rolePrefix
- the prefix (defaults to "ROLE_").
|
Spring Security Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |