public class LdapUserDetailsImpl extends java.lang.Object implements LdapUserDetails, PasswordPolicyData
An instance may be created as the result of a search, or when user information is retrieved during authentication.
An instance of this class will be used by the LdapAuthenticationProvider to construct the final user details object that it returns.
The equals
and hashcode
methods are implemented using the Dn
property and do not consider additional state, so it is not possible two store two
instances with the same DN in the same set, or use them as keys in a map.
Modifier and Type | Class and Description |
---|---|
static class |
LdapUserDetailsImpl.Essence
Variation of essence pattern.
|
Modifier | Constructor and Description |
---|---|
protected |
LdapUserDetailsImpl() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
void |
eraseCredentials() |
java.util.Collection<GrantedAuthority> |
getAuthorities()
Returns the authorities granted to the user.
|
java.lang.String |
getDn()
The DN of the entry for this user's account.
|
int |
getGraceLoginsRemaining() |
java.lang.String |
getPassword()
Returns the password used to authenticate the user.
|
int |
getTimeBeforeExpiration() |
java.lang.String |
getUsername()
Returns the username used to authenticate the user.
|
int |
hashCode() |
boolean |
isAccountNonExpired()
Indicates whether the user's account has expired.
|
boolean |
isAccountNonLocked()
Indicates whether the user is locked or unlocked.
|
boolean |
isCredentialsNonExpired()
Indicates whether the user's credentials (password) has expired.
|
boolean |
isEnabled()
Indicates whether the user is enabled or disabled.
|
java.lang.String |
toString() |
public java.util.Collection<GrantedAuthority> getAuthorities()
UserDetails
null
.getAuthorities
in interface UserDetails
null
)public java.lang.String getDn()
LdapUserDetails
getDn
in interface LdapUserDetails
public java.lang.String getPassword()
UserDetails
getPassword
in interface UserDetails
public java.lang.String getUsername()
UserDetails
null
.getUsername
in interface UserDetails
null
)public boolean isAccountNonExpired()
UserDetails
isAccountNonExpired
in interface UserDetails
true
if the user's account is valid (ie non-expired),
false
if no longer valid (ie expired)public boolean isAccountNonLocked()
UserDetails
isAccountNonLocked
in interface UserDetails
true
if the user is not locked, false
otherwisepublic boolean isCredentialsNonExpired()
UserDetails
isCredentialsNonExpired
in interface UserDetails
true
if the user's credentials are valid (ie non-expired),
false
if no longer valid (ie expired)public boolean isEnabled()
UserDetails
isEnabled
in interface UserDetails
true
if the user is enabled, false
otherwisepublic void eraseCredentials()
eraseCredentials
in interface CredentialsContainer
public int getTimeBeforeExpiration()
getTimeBeforeExpiration
in interface PasswordPolicyData
public int getGraceLoginsRemaining()
getGraceLoginsRemaining
in interface PasswordPolicyData
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object