Class LocalCrowdAuthenticationProvider
java.lang.Object
com.atlassian.crowd.integration.springsecurity.CrowdAuthenticationProvider
com.atlassian.crowd.integration.springsecurity.LocalCrowdAuthenticationProvider
- All Implemented Interfaces:
org.springframework.security.authentication.AuthenticationProvider
- Direct Known Subclasses:
CrowdApplicationAuthenticationProvider,CrowdApplicationModuleAuthenticationProvider
Application-aware local authentication provider.
Does not make SOAP calls.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLocalCrowdAuthenticationProvider(ApplicationService applicationService, ApplicationManager applicationManager, TokenAuthenticationManager tokenAuthenticationManager) -
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 UserAuthenticationContextprotected abstract org.springframework.security.core.GrantedAuthority[]findGrantedAuthorities(String username) protected Applicationprotected abstract Stringprotected 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 tokenKey) 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.booleansupports(org.springframework.security.authentication.AbstractAuthenticationToken authenticationToken) Methods inherited from class com.atlassian.crowd.integration.springsecurity.CrowdAuthenticationProvider
authenticate, authenticateCrowdRememberedUsername, authenticateCrowdSSO, authenticateUsernamePassword, supports, translateException
-
Field Details
-
applicationService
-
-
Constructor Details
-
LocalCrowdAuthenticationProvider
public LocalCrowdAuthenticationProvider(ApplicationService applicationService, ApplicationManager applicationManager, TokenAuthenticationManager tokenAuthenticationManager)
-
-
Method Details
-
isAuthenticated
protected boolean isAuthenticated(String token, List<ValidationFactor> validationFactors) throws OperationFailedException 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:
OperationFailedException
-
authenticate
protected String authenticate(String username, String password, List<ValidationFactor> validationFactors) throws InvalidAuthenticationException, InactiveAccountException, ApplicationAccessDeniedException, ExpiredCredentialException, OperationFailedException 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.InactiveAccountExceptionApplicationAccessDeniedExceptionExpiredCredentialExceptionOperationFailedException
-
createUserAuthenticationContext
-
authenticateWithoutPassword
protected String authenticateWithoutPassword(String username, List<ValidationFactor> validationFactors) throws InvalidAuthenticationException, InactiveAccountException, ApplicationAccessDeniedException, ExpiredCredentialException, OperationFailedException 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.InactiveAccountExceptionApplicationAccessDeniedExceptionExpiredCredentialExceptionOperationFailedException
-
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 tokenKey) 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:
tokenKey- 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.
-
findGrantedAuthorities
protected abstract org.springframework.security.core.GrantedAuthority[] findGrantedAuthorities(String username) throws ApplicationNotFoundException - Throws:
ApplicationNotFoundException
-
getApplication
- Throws:
ApplicationNotFoundException
-
supports
public boolean supports(org.springframework.security.authentication.AbstractAuthenticationToken authenticationToken) - Overrides:
supportsin classCrowdAuthenticationProvider
-
getApplicationName
-