public class

LdapUserDetailsImpl

extends Object
implements PasswordPolicyData LdapUserDetails
java.lang.Object
   ↳ org.springframework.security.ldap.userdetails.LdapUserDetailsImpl
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

A UserDetails implementation which is used internally by the Ldap services. It also contains the user's distinguished name and a set of attributes that have been retrieved from the Ldap server.

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.

Summary

Nested Classes
class LdapUserDetailsImpl.Essence Variation of essence pattern. 
Protected Constructors
LdapUserDetailsImpl()
Public Methods
boolean equals(Object obj)
Collection<GrantedAuthority> getAuthorities()
Returns the authorities granted to the user.
String getDn()
The DN of the entry for this user's account.
int getGraceLoginsRemaining()
String getPassword()
Returns the password used to authenticate the user.
int getTimeBeforeExpiration()
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.
String toString()
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.springframework.security.core.userdetails.UserDetails
From interface org.springframework.security.ldap.ppolicy.PasswordPolicyData
From interface org.springframework.security.ldap.userdetails.LdapUserDetails

Protected Constructors

protected LdapUserDetailsImpl ()

Public Methods

public boolean equals (Object obj)

public Collection<GrantedAuthority> getAuthorities ()

Returns the authorities granted to the user. Cannot return null.

Returns
  • the authorities, sorted by natural key (never null)

public String getDn ()

The DN of the entry for this user's account.

Returns
  • the user's DN

public int getGraceLoginsRemaining ()

public String getPassword ()

Returns the password used to authenticate the user. Cannot return null.

Returns
  • the password (never null)

public int getTimeBeforeExpiration ()

public String getUsername ()

Returns the username used to authenticate the user. Cannot return null.

Returns
  • the username (never null)

public int hashCode ()

public boolean isAccountNonExpired ()

Indicates whether the user's account has expired. An expired account cannot be authenticated.

Returns
  • true if the user's account is valid (ie non-expired), false if no longer valid (ie expired)

public boolean isAccountNonLocked ()

Indicates whether the user is locked or unlocked. A locked user cannot be authenticated.

Returns
  • true if the user is not locked, false otherwise

public boolean isCredentialsNonExpired ()

Indicates whether the user's credentials (password) has expired. Expired credentials prevent authentication.

Returns
  • true if the user's credentials are valid (ie non-expired), false if no longer valid (ie expired)

public boolean isEnabled ()

Indicates whether the user is enabled or disabled. A disabled user cannot be authenticated.

Returns
  • true if the user is enabled, false otherwise

public String toString ()