com.atlassian.crowd.integration.acegi.user
Class CrowdUserDetails

java.lang.Object
  extended by com.atlassian.crowd.integration.acegi.user.CrowdUserDetails
All Implemented Interfaces:
Serializable, org.acegisecurity.userdetails.UserDetails

public class CrowdUserDetails
extends Object
implements org.acegisecurity.userdetails.UserDetails

Implements a basic SOAPPrincipal wrapper for Crowd principals. All attributes on this object are obtained directly from the Crowd server.

Author:
Shihab Hamid
See Also:
Serialized Form

Constructor Summary
CrowdUserDetails(SOAPPrincipal principal, org.acegisecurity.GrantedAuthority[] authorities)
           
 
Method Summary
 String getAttribute(String attributeName)
           
 org.acegisecurity.GrantedAuthority[] getAuthorities()
          Returns the authorities granted to the user.
 String getEmail()
           
 String getFirstName()
           
 String getFullName()
           
 String getLastName()
           
 String getPassword()
          Returns the password used to authenticate the user.
 SOAPPrincipal getRemotePrincipal()
           
 String getUsername()
          Returns the username used to authenticate the user.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CrowdUserDetails

public CrowdUserDetails(SOAPPrincipal principal,
                        org.acegisecurity.GrantedAuthority[] authorities)
Method Detail

getAuthorities

public org.acegisecurity.GrantedAuthority[] getAuthorities()
Returns the authorities granted to the user. Cannot return null.

Specified by:
getAuthorities in interface org.acegisecurity.userdetails.UserDetails
Returns:
the authorities (never null)

getRemotePrincipal

public SOAPPrincipal getRemotePrincipal()

getPassword

public String getPassword()
Returns the password used to authenticate the user. Cannot return null.

Specified by:
getPassword in interface org.acegisecurity.userdetails.UserDetails
Returns:
the password (never null). Always throws UnsupportedOperationException as we don't want to risk exposing the password of a user.

getUsername

public String getUsername()
Returns the username used to authenticate the user. Cannot return null.

Specified by:
getUsername in interface org.acegisecurity.userdetails.UserDetails
Returns:
the username (never null)

isAccountNonExpired

public boolean isAccountNonExpired()
Indicates whether the user's account has expired. An expired account cannot be authenticated.

Specified by:
isAccountNonExpired in interface org.acegisecurity.userdetails.UserDetails
Returns:
true always.

isAccountNonLocked

public boolean isAccountNonLocked()
Indicates whether the user is locked or unlocked. A locked user cannot be authenticated.

Specified by:
isAccountNonLocked in interface org.acegisecurity.userdetails.UserDetails
Returns:
true always.

isCredentialsNonExpired

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

Specified by:
isCredentialsNonExpired in interface org.acegisecurity.userdetails.UserDetails
Returns:
true always.

isEnabled

public boolean isEnabled()
Indicates whether the user is enabled or disabled. A disabled user cannot be authenticated.

Specified by:
isEnabled in interface org.acegisecurity.userdetails.UserDetails
Returns:
true if the user is active, false otherwise.

getFirstName

public String getFirstName()

getLastName

public String getLastName()

getEmail

public String getEmail()

getFullName

public String getFullName()

getAttribute

public String getAttribute(String attributeName)


Copyright © 2012 Atlassian. All Rights Reserved.