public class ReadOnlyLDAPUser extends Object implements User, Serializable
ReadOnlyUsersLDAPRepositoryor its subclasses. Consequently it does not permit the mutation of user details. It is intended purely as an encapsulation of the user information as held in the LDAP directory, and as a means of authenticating the user against the LDAP server. Consequently invocations of the contract method
|Constructor and Description|
Constructs an instance for the given user-details, and which will authenticate against the given host.
|Modifier and Type||Method and Description|
Fulfils the contract
Implementation of contract
Verifies that the password supplied is actually the user's password, by attempting to rebind to a copy of the LDAP server context using the user's username and the supplied password.
public ReadOnlyLDAPUser(String userName, String userDN, LdapContext ldapContext) throws NamingException
userName- The user-identifier/name. This is the value with which the field
#userNamewill be initialised, and which will be returned by invoking
userDN- The distinguished (unique-key) of the user details as stored on the LDAP directory.
ldapContext- The context for the LDAP server on which the user details are held. This is also the host against which the user will be authenticated, when
public String getUserName()
User.getUserName(). It returns the value of the field
#userName. This is generally the value from which the user email address is built, by appending the domain name to it.
public boolean setPassword(String newPass)
User.setPassword(String), which is provided for compliance purposes only. Instances of this type mirror LDAP data and do not perform any updates to the directory. Consequently, this method always returns
falseand does not do any work.
public boolean verifyPassword(String password)
Copyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.