public abstract class CrowdAuthenticationProvider extends Object implements org.springframework.security.authentication.AuthenticationProvider
| Constructor and Description |
|---|
CrowdAuthenticationProvider() |
| Modifier and Type | Method and Description |
|---|---|
org.springframework.security.core.Authentication |
authenticate(org.springframework.security.core.Authentication authentication)
Performs authentication with the same contract as
org.springframework.security.AuthenticationManager#authenticate(org.springframework.security.Authentication). |
protected abstract String |
authenticate(String username,
String password,
List<com.atlassian.crowd.model.authentication.ValidationFactor> validationFactors)
Authenticate a remote user and return the Crowd SSO token string.
|
protected org.springframework.security.core.Authentication |
authenticateCrowdSSO(CrowdSSOAuthenticationToken ssoToken)
Attempts to authenticate based on an existing Crowd token and validation factors
from a HttpServletRequest.
|
protected org.springframework.security.core.Authentication |
authenticateUsernamePassword(org.springframework.security.authentication.UsernamePasswordAuthenticationToken passwordToken)
Attempts to authenticate a login request based on username (principal), password (credentials),
and (optional) ValidationFactor[]s (details).
|
protected abstract boolean |
isAuthenticated(String token,
List<com.atlassian.crowd.model.authentication.ValidationFactor> validationFactors)
Determine if a remote user is authenticated via SSO based on
the supplied SSO token string and validation factors.
|
protected abstract CrowdUserDetails |
loadUserByToken(String token)
Retrieve a user from Crowd by looking up the principal by their authenticated Crowd token.
|
protected abstract CrowdUserDetails |
loadUserByUsername(String username)
Retreive the user details for a user based on their username.
|
boolean |
supports(org.springframework.security.authentication.AbstractAuthenticationToken authenticationToken) |
boolean |
supports(Class<?> authentication)
Returns
true if this AuthenticationProvider supports the indicated
Authentication object. |
protected org.springframework.security.core.AuthenticationException |
translateException(Exception e)
Converts Crowd-specific exceptions to Spring Security-friendly exceptions.
|
public org.springframework.security.core.Authentication authenticate(org.springframework.security.core.Authentication authentication)
throws org.springframework.security.core.AuthenticationException
org.springframework.security.AuthenticationManager#authenticate(org.springframework.security.Authentication).
This AuthenticationProvider supports UsernamePasswordAuthenticationTokens for
login operations where a username, password and possiblyy validation factors (for SSO)
are provided. It also supports CrowdSSOAuthenticationToken for authentication
verification operations, where the SSO token and validation factors are provided
for SSO authentication.
See CrowdAuthenticationProvider.authenticateUsernamePassword() and
CrowdAuthenticationProvider.authenticateCrowdSSO() for more specific
information on the authentication process.authenticate in interface org.springframework.security.authentication.AuthenticationProviderauthentication - the authentication request object.null if the
AuthenticationProvider is unable to support authentication of the passed
Authentication object. In such a case, the next AuthenticationProvider that
supports the presented Authentication class will be tried.org.springframework.security.AuthenticationException - if authentication fails.org.springframework.security.core.AuthenticationExceptionprotected org.springframework.security.core.Authentication authenticateUsernamePassword(org.springframework.security.authentication.UsernamePasswordAuthenticationToken passwordToken)
throws org.springframework.security.core.AuthenticationException
passwordToken - authentication token containing the username, password and (optiona) ValidationFactor[]s.org.springframework.security.core.AuthenticationException - if there was a problem authenticating the username/password combination.protected abstract boolean isAuthenticated(String token, List<com.atlassian.crowd.model.authentication.ValidationFactor> validationFactors) throws OperationFailedException, InvalidAuthenticationException, ApplicationPermissionException
token - Crowd SSO token.validationFactors - validation factors.true iff the remote user is authenticated.OperationFailedExceptionInvalidAuthenticationExceptionApplicationPermissionExceptionprotected abstract String authenticate(String username, String password, List<com.atlassian.crowd.model.authentication.ValidationFactor> validationFactors) throws InactiveAccountException, ExpiredCredentialException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException, ApplicationAccessDeniedException
username - username of the remote user.password - password of the remote user.validationFactors - validation factors from the remote user.InvalidAuthorizationTokenException - invalid application client.InvalidAuthenticationException - invalid username/password.InactiveAccountExceptionExpiredCredentialExceptionApplicationPermissionExceptionOperationFailedExceptionApplicationAccessDeniedExceptionprotected abstract CrowdUserDetails loadUserByUsername(String username) throws org.springframework.security.core.userdetails.UsernameNotFoundException, org.springframework.dao.DataAccessException
username - username of user.org.springframework.security.core.userdetails.UsernameNotFoundException - user with supplied username does not exist.org.springframework.dao.DataAccessException - error retrieving user.protected abstract CrowdUserDetails loadUserByToken(String token) throws CrowdSSOTokenInvalidException, org.springframework.dao.DataAccessException
token - Crowd SSO token string.CrowdSSOTokenInvalidException - if the provided token is invalid.org.springframework.dao.DataAccessException - error retrieveing user.protected org.springframework.security.core.Authentication authenticateCrowdSSO(CrowdSSOAuthenticationToken ssoToken) throws org.springframework.security.core.AuthenticationException
ssoToken - ssoToken containing the token string credential and validation factors as details.org.springframework.security.core.AuthenticationException - if there was a problem verifying the existing token is valid.protected org.springframework.security.core.AuthenticationException translateException(Exception e)
e - Crowd-specific exception.public boolean supports(Class<?> authentication)
true if this AuthenticationProvider supports the indicated
Authentication object.
The CrowdAuthenticationProvider supports UsernamePasswordAuthenticationTokens
and CrowdSSOAuthenticationTokens.
supports in interface org.springframework.security.authentication.AuthenticationProviderpublic boolean supports(org.springframework.security.authentication.AbstractAuthenticationToken authenticationToken)
Copyright © 2017 Atlassian. All rights reserved.