Class PasswordComparisonAuthenticator
- java.lang.Object
-
- org.springframework.security.ldap.authentication.AbstractLdapAuthenticator
-
- org.springframework.security.ldap.authentication.PasswordComparisonAuthenticator
-
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.beans.factory.InitializingBean
,org.springframework.context.MessageSourceAware
,LdapAuthenticator
public final class PasswordComparisonAuthenticator extends AbstractLdapAuthenticator
AnLdapAuthenticator
which compares the login password with the value stored in the directory using a remote LDAP "compare" operation.If passwords are stored in digest form in the repository, then a suitable
PasswordEncoder
implementation must be supplied. By default, passwords are encoded using theLdapShaPasswordEncoder
. Note that compare operations will not work if salted-SHA (SSHA) passwords are used, as it is not possible to know the salt value which is a random byte sequence generated by the directory.
-
-
Field Summary
-
Fields inherited from class org.springframework.security.ldap.authentication.AbstractLdapAuthenticator
messages
-
-
Constructor Summary
Constructors Constructor Description PasswordComparisonAuthenticator(org.springframework.ldap.core.support.BaseLdapPathContextSource contextSource)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.ldap.core.DirContextOperations
authenticate(Authentication authentication)
Authenticates as a user and obtains additional user information from the directory.void
setPasswordAttributeName(java.lang.String passwordAttribute)
void
setPasswordEncoder(PasswordEncoder passwordEncoder)
void
setUsePasswordAttrCompare(boolean usePasswordAttrCompare)
-
Methods inherited from class org.springframework.security.ldap.authentication.AbstractLdapAuthenticator
afterPropertiesSet, getContextSource, getUserAttributes, getUserDns, getUserSearch, setMessageSource, setUserAttributes, setUserDnPatterns, setUserSearch
-
-
-
-
Method Detail
-
authenticate
public org.springframework.ldap.core.DirContextOperations authenticate(Authentication authentication)
Description copied from interface:LdapAuthenticator
Authenticates as a user and obtains additional user information from the directory.- Returns:
- the details of the successfully authenticated user.
-
setPasswordAttributeName
public void setPasswordAttributeName(java.lang.String passwordAttribute)
-
setUsePasswordAttrCompare
public void setUsePasswordAttrCompare(boolean usePasswordAttrCompare)
-
setPasswordEncoder
public void setPasswordEncoder(PasswordEncoder passwordEncoder)
-
-