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 String
authenticate
(String username, String password, List<ValidationFactor> validationFactors) Authenticate a remote user and return the Crowd SSO token string.protected String
authenticateWithoutPassword
(String username, List<ValidationFactor> validationFactors) Authenticate a remote user without password and return the Crowd SSO token string.protected UserAuthenticationContext
protected abstract org.springframework.security.core.GrantedAuthority[]
findGrantedAuthorities
(String username) protected Application
protected abstract String
protected boolean
isAuthenticated
(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 CrowdUserDetails
loadUserByToken
(String tokenKey) 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.boolean
supports
(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:CrowdAuthenticationProvider
Determine if a remote user is authenticated via SSO based on the supplied SSO token string and validation factors.- Specified by:
isAuthenticated
in classCrowdAuthenticationProvider
- Parameters:
token
- Crowd SSO token.validationFactors
- validation factors.- Returns:
true
iff 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:CrowdAuthenticationProvider
Authenticate a remote user and return the Crowd SSO token string.- Specified by:
authenticate
in 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.InactiveAccountException
ApplicationAccessDeniedException
ExpiredCredentialException
OperationFailedException
-
createUserAuthenticationContext
-
authenticateWithoutPassword
protected String authenticateWithoutPassword(String username, List<ValidationFactor> validationFactors) throws InvalidAuthenticationException, InactiveAccountException, ApplicationAccessDeniedException, ExpiredCredentialException, OperationFailedException Description copied from class:CrowdAuthenticationProvider
Authenticate a remote user without password and return the Crowd SSO token string.- Specified by:
authenticateWithoutPassword
in classCrowdAuthenticationProvider
- Parameters:
username
- username of the remote user.validationFactors
- validation factors from the remote user.- Returns:
- Crowd SSO token string
- Throws:
InvalidAuthenticationException
- invalid username.InactiveAccountException
ApplicationAccessDeniedException
ExpiredCredentialException
OperationFailedException
-
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 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:CrowdAuthenticationProvider
Retrieve a user from Crowd by looking up the principal by their authenticated Crowd token.- Specified by:
loadUserByToken
in 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:
supports
in classCrowdAuthenticationProvider
-
getApplicationName
-