com.atlassian.crowd.plugin.application.springsecurity
Class LocalCrowdAuthenticationProvider

java.lang.Object
  extended by com.atlassian.crowd.integration.springsecurity.CrowdAuthenticationProvider
      extended by com.atlassian.crowd.plugin.application.springsecurity.LocalCrowdAuthenticationProvider
All Implemented Interfaces:
org.springframework.security.providers.AuthenticationProvider

public class LocalCrowdAuthenticationProvider
extends CrowdAuthenticationProvider

Application-aware local authentication provider.

Does not make SOAP calls.


Field Summary
 
Fields inherited from class com.atlassian.crowd.integration.springsecurity.CrowdAuthenticationProvider
applicationName
 
Constructor Summary
LocalCrowdAuthenticationProvider(Application application, ApplicationService applicationService, ApplicationManager applicationManager, TokenAuthenticationManager tokenAuthenticationManager)
           
 
Method Summary
protected  java.lang.String authenticate(java.lang.String username, java.lang.String password, ValidationFactor[] validationFactors)
          Authenticate a remote user and return the Crowd SSO token string.
protected  boolean isAuthenticated(java.lang.String token, ValidationFactor[] validationFactors)
          Determine if a remote user is authenticated via SSO based on the supplied SSO token string and validation factors.
protected  CrowdUserDetails loadUserByToken(java.lang.String token)
          Retrieve a user from Crowd by looking up the principal by their authenticated Crowd token.
protected  CrowdUserDetails loadUserByUsername(java.lang.String username)
          Retreive the user details for a user based on their username.
 
Methods inherited from class com.atlassian.crowd.integration.springsecurity.CrowdAuthenticationProvider
authenticate, authenticateCrowdSSO, authenticateUsernamePassword, supports, supports, translateException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalCrowdAuthenticationProvider

public LocalCrowdAuthenticationProvider(Application application,
                                        ApplicationService applicationService,
                                        ApplicationManager applicationManager,
                                        TokenAuthenticationManager tokenAuthenticationManager)
Method Detail

isAuthenticated

protected boolean isAuthenticated(java.lang.String token,
                                  ValidationFactor[] validationFactors)
                           throws InvalidAuthorizationTokenException,
                                  ApplicationAccessDeniedException,
                                  java.rmi.RemoteException
Description copied from class: CrowdAuthenticationProvider
Determine if a remote user is authenticated via SSO based on the supplied SSO token string and validation factors.

Specified by:
isAuthenticated in class CrowdAuthenticationProvider
Parameters:
token - Crowd SSO token.
validationFactors - validation factors.
Returns:
true iff the remote user is authenticated.
Throws:
InvalidAuthorizationTokenException - invalid application client.
ApplicationAccessDeniedException - user does not have access to the application.
java.rmi.RemoteException - Crowd server error.

authenticate

protected java.lang.String authenticate(java.lang.String username,
                                        java.lang.String password,
                                        ValidationFactor[] validationFactors)
                                 throws InvalidAuthorizationTokenException,
                                        InvalidAuthenticationException,
                                        InactiveAccountException,
                                        ApplicationAccessDeniedException,
                                        java.rmi.RemoteException,
                                        ExpiredCredentialException
Description copied from class: CrowdAuthenticationProvider
Authenticate a remote user and return the Crowd SSO token string.

Specified by:
authenticate in class CrowdAuthenticationProvider
Parameters:
username - username of the remote user.
password - password of the remote user.
validationFactors - validation factors from the remote user.
Returns:
Crowd SSO token string
Throws:
InvalidAuthorizationTokenException - invalid application client.
InvalidAuthenticationException - invalid username/password.
InactiveAccountException - inactive user account.
ApplicationAccessDeniedException - user does not have access to the application.
java.rmi.RemoteException - Crowd server error.
ExpiredCredentialException - The user's credentials have expired. The user must change their credentials in order to successfully authenticate.

loadUserByUsername

protected CrowdUserDetails loadUserByUsername(java.lang.String username)
                                       throws org.springframework.security.userdetails.UsernameNotFoundException,
                                              org.springframework.dao.DataAccessException
Description copied from class: CrowdAuthenticationProvider
Retreive the user details for a user based on their username.

Specified by:
loadUserByUsername in class CrowdAuthenticationProvider
Parameters:
username - username of user.
Returns:
user details of user.
Throws:
org.springframework.security.userdetails.UsernameNotFoundException - user with supplied username does not exist.
org.springframework.dao.DataAccessException - error retrieving user.

loadUserByToken

protected CrowdUserDetails loadUserByToken(java.lang.String token)
                                    throws CrowdSSOTokenInvalidException,
                                           org.springframework.dao.DataAccessException
Description copied from class: CrowdAuthenticationProvider
Retrieve a user from Crowd by looking up the principal by their authenticated Crowd token.

Specified by:
loadUserByToken in class CrowdAuthenticationProvider
Parameters:
token - Crowd SSO token string.
Returns:
CrowdUserDetails corresponding to the principal.
Throws:
CrowdSSOTokenInvalidException - if the provided token is invalid.
org.springframework.dao.DataAccessException - error retrieveing user.


Copyright © 2010 Atlassian. All Rights Reserved.