org.acegisecurity.providers.ldap.authenticator
Class PasswordComparisonAuthenticator
java.lang.Object
org.acegisecurity.providers.ldap.authenticator.AbstractLdapAuthenticator
org.acegisecurity.providers.ldap.authenticator.PasswordComparisonAuthenticator
- All Implemented Interfaces:
- LdapAuthenticator, org.springframework.beans.factory.InitializingBean, org.springframework.context.MessageSourceAware
public final class PasswordComparisonAuthenticator
- extends AbstractLdapAuthenticator
An LdapAuthenticator
which compares the login
password with the value stored in the directory.
This can be achieved either by retrieving the password attribute for the user and comparing it locally,
or by peforming an LDAP "compare" operation. If the password attribute (default "userPassword") is found in the
retrieved attributes it will be compared locally. If not, the remote comparison will be attempted.
If passwords are stored in digest form in the repository, then a suitable PasswordEncoder
implementation must be supplied. By default, passwords are encoded using the LdapShaPasswordEncoder
.
- Version:
- $Id: PasswordComparisonAuthenticator.java 1784 2007-02-24 21:00:24Z luke_t $
- Author:
- Luke Taylor
Methods inherited from class org.acegisecurity.providers.ldap.authenticator.AbstractLdapAuthenticator |
afterPropertiesSet, getInitialDirContextFactory, getUserAttributes, getUserDetailsMapper, getUserDns, getUserSearch, setMessageSource, setUserAttributes, setUserDetailsMapper, setUserDnPatterns, setUserSearch |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PasswordComparisonAuthenticator
public PasswordComparisonAuthenticator(InitialDirContextFactory initialDirContextFactory)
authenticate
public LdapUserDetails authenticate(String username,
String password)
- Description copied from interface:
LdapAuthenticator
- Authenticates as a user and obtains additional user information from the directory.
- Parameters:
username
- the user's login name (not their DN).password
- the user's password supplied at login.
- Returns:
- the details of the successfully authenticated user.
setPasswordAttributeName
public void setPasswordAttributeName(String passwordAttribute)
setPasswordEncoder
public void setPasswordEncoder(PasswordEncoder passwordEncoder)
Copyright © 2004-2009 Interface21, Inc. All Rights Reserved.