Class RemoteCrowdAuthenticationProvider
java.lang.Object
com.atlassian.crowd.integration.springsecurity.CrowdAuthenticationProvider
com.atlassian.crowd.integration.springsecurity.RemoteCrowdAuthenticationProvider
- All Implemented Interfaces:
org.springframework.security.authentication.AuthenticationProvider
A concrete implementation of the CrowdAuthenticationProvider that uses
the crowd client libraries to communicate with the Crowd server.
This should be the class developers use to integrate Crowd and Spring Security.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final CrowdClientprotected final CrowdHttpAuthenticatorprotected final CrowdUserDetailsService -
Constructor Summary
ConstructorsConstructorDescriptionRemoteCrowdAuthenticationProvider(CrowdClient authenticationManager, CrowdHttpAuthenticator httpAuthenticator, CrowdUserDetailsService userDetailsService) -
Method Summary
Modifier and TypeMethodDescriptionprotected Stringauthenticate(String username, String password, List<ValidationFactor> validationFactors) Authenticate a remote user and return the Crowd SSO token string.protected StringauthenticateWithoutPassword(String username, List<ValidationFactor> validationFactors) Authenticate a remote user without password and return the Crowd SSO token string.protected booleanisAuthenticated(String token, List<ValidationFactor> validationFactors) Determine if a remote user is authenticated via SSO based on the supplied SSO token string and validation factors.protected CrowdUserDetailsloadUserByToken(String token) Retrieve a user from Crowd by looking up the principal by their authenticated Crowd token.protected CrowdUserDetailsloadUserByUsername(String username) Retreive the user details for a user based on their username.Methods inherited from class com.atlassian.crowd.integration.springsecurity.CrowdAuthenticationProvider
authenticate, authenticateCrowdRememberedUsername, authenticateCrowdSSO, authenticateUsernamePassword, supports, supports, translateException
-
Field Details
-
authenticationManager
-
httpAuthenticator
-
userDetailsService
-
-
Constructor Details
-
RemoteCrowdAuthenticationProvider
public RemoteCrowdAuthenticationProvider(CrowdClient authenticationManager, CrowdHttpAuthenticator httpAuthenticator, CrowdUserDetailsService userDetailsService)
-
-
Method Details
-
isAuthenticated
protected boolean isAuthenticated(String token, List<ValidationFactor> validationFactors) throws OperationFailedException, InvalidAuthenticationException, ApplicationPermissionException Description copied from class:CrowdAuthenticationProviderDetermine if a remote user is authenticated via SSO based on the supplied SSO token string and validation factors.- Specified by:
isAuthenticatedin classCrowdAuthenticationProvider- Parameters:
token- Crowd SSO token.validationFactors- validation factors.- Returns:
trueiff the remote user is authenticated.- Throws:
OperationFailedExceptionInvalidAuthenticationExceptionApplicationPermissionException
-
authenticate
protected String authenticate(String username, String password, List<ValidationFactor> validationFactors) throws InactiveAccountException, ExpiredCredentialException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException, ApplicationAccessDeniedException Description copied from class:CrowdAuthenticationProviderAuthenticate a remote user and return the Crowd SSO token string.- Specified by:
authenticatein classCrowdAuthenticationProvider- 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:
InvalidAuthenticationException- invalid username/password.InactiveAccountExceptionExpiredCredentialExceptionApplicationPermissionExceptionOperationFailedExceptionApplicationAccessDeniedException
-
authenticateWithoutPassword
protected String authenticateWithoutPassword(String username, List<ValidationFactor> validationFactors) throws InactiveAccountException, ExpiredCredentialException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException, ApplicationAccessDeniedException Description copied from class:CrowdAuthenticationProviderAuthenticate a remote user without password and return the Crowd SSO token string.- Specified by:
authenticateWithoutPasswordin classCrowdAuthenticationProvider- Parameters:
username- username of the remote user.validationFactors- validation factors from the remote user.- Returns:
- Crowd SSO token string
- Throws:
InvalidAuthenticationException- invalid username.InactiveAccountExceptionExpiredCredentialExceptionApplicationPermissionExceptionOperationFailedExceptionApplicationAccessDeniedException
-
loadUserByUsername
protected CrowdUserDetails loadUserByUsername(String username) throws org.springframework.security.core.userdetails.UsernameNotFoundException, org.springframework.dao.DataAccessException Description copied from class:CrowdAuthenticationProviderRetreive the user details for a user based on their username.- Specified by:
loadUserByUsernamein classCrowdAuthenticationProvider- 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:CrowdAuthenticationProviderRetrieve a user from Crowd by looking up the principal by their authenticated Crowd token.- Specified by:
loadUserByTokenin classCrowdAuthenticationProvider- 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.
-