com.atlassian.crowd.integration.springsecurity
Class RemoteCrowdAuthenticationProvider

java.lang.Object
  extended by com.atlassian.crowd.integration.springsecurity.CrowdAuthenticationProvider
      extended by com.atlassian.crowd.integration.springsecurity.RemoteCrowdAuthenticationProvider
All Implemented Interfaces:
org.springframework.security.authentication.AuthenticationProvider

public class RemoteCrowdAuthenticationProvider
extends CrowdAuthenticationProvider

A concrete implementation of the CrowdAuthenticationProvider that uses the crowd client libraries (SOAP) to communicate with the Crowd server. This should be the class developers use to integrate Crowd and Spring Security.


Field Summary
protected  AuthenticationManager authenticationManager
           
protected  HttpAuthenticator httpAuthenticator
           
protected  CrowdUserDetailsService userDetailsService
           
 
Fields inherited from class com.atlassian.crowd.integration.springsecurity.CrowdAuthenticationProvider
applicationName
 
Constructor Summary
RemoteCrowdAuthenticationProvider(AuthenticationManager authenticationManager, HttpAuthenticator httpAuthenticator, CrowdUserDetailsService userDetailsService)
           
 
Method Summary
protected  String authenticate(String username, String password, ValidationFactor[] validationFactors)
          Authenticate a remote user and return the Crowd SSO token string.
protected  boolean isAuthenticated(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(String token)
          Retrieve a user from Crowd by looking up the principal by their authenticated Crowd token.
protected  CrowdUserDetails loadUserByUsername(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
 

Field Detail

authenticationManager

protected final AuthenticationManager authenticationManager

httpAuthenticator

protected final HttpAuthenticator httpAuthenticator

userDetailsService

protected final CrowdUserDetailsService userDetailsService
Constructor Detail

RemoteCrowdAuthenticationProvider

public RemoteCrowdAuthenticationProvider(AuthenticationManager authenticationManager,
                                         HttpAuthenticator httpAuthenticator,
                                         CrowdUserDetailsService userDetailsService)
Method Detail

isAuthenticated

protected boolean isAuthenticated(String token,
                                  ValidationFactor[] validationFactors)
                           throws InvalidAuthorizationTokenException,
                                  RemoteException,
                                  ApplicationAccessDeniedException,
                                  InvalidAuthenticationException
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.
RemoteException - Crowd server error.
ApplicationAccessDeniedException - user does not have access to the application.
InvalidAuthenticationException

authenticate

protected String authenticate(String username,
                              String password,
                              ValidationFactor[] validationFactors)
                       throws InvalidAuthorizationTokenException,
                              InvalidAuthenticationException,
                              RemoteException,
                              InactiveAccountException,
                              ApplicationAccessDeniedException,
                              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.
RemoteException - Crowd server error.
InactiveAccountException - inactive user account.
ApplicationAccessDeniedException - user does not have access to the application.
ExpiredCredentialException - The user's credentials have expired. The user must change their credentials in order to successfully authenticate.

loadUserByUsername

protected CrowdUserDetails loadUserByUsername(String username)
                                       throws org.springframework.security.core.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.core.userdetails.UsernameNotFoundException - user with supplied username does not exist.
org.springframework.dao.DataAccessException - error retrieving user.

loadUserByToken

protected CrowdUserDetails loadUserByToken(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 © 2013 Atlassian. All Rights Reserved.