public class CacheAwareAuthenticationManager extends Object implements AuthenticationManager
SecurityServerClient.
It also serves to logically break out the API.
| Constructor and Description |
|---|
CacheAwareAuthenticationManager(SecurityServerClient securityServerClient,
UserManager crowdUserManager) |
| Modifier and Type | Method and Description |
|---|---|
String |
authenticate(String username,
String password)
Authenticates a user, using just a username and password.
|
String |
authenticate(UserAuthenticationContext authenticationContext)
Authenticate a user.
|
String |
authenticateWithoutValidatingPassword(UserAuthenticationContext authenticationContext)
Authenticate a user without validating their password.
|
SecurityServerClient |
getSecurityServerClient()
Returns an instance of the
SecurityServerClient, for when you need more API access than the
authentication manager provides. |
void |
invalidate(String token)
Marks the presented
token as invalid, meaning that the principal it represents is no longer
authenticated. |
boolean |
isAuthenticated(String token,
ValidationFactor[] validationFactors)
Checks that the token (as returned from
AuthenticationManager.authenticate(com.atlassian.crowd.model.authentication.UserAuthenticationContext) is still valid, given the validation factors. |
public CacheAwareAuthenticationManager(SecurityServerClient securityServerClient, UserManager crowdUserManager)
public String authenticate(UserAuthenticationContext authenticationContext) throws RemoteException, InvalidAuthorizationTokenException, InvalidAuthenticationException, InactiveAccountException, ApplicationAccessDeniedException, ExpiredCredentialException
AuthenticationManagerPrincipalAuthenticationContext contains the details of who they are,
the credentials they're presenting, and where they're coming from.
If the authenticationContext does not contain application details, they will be added using details provided
by the SecurityServerClient.authenticate in interface AuthenticationManagerauthenticationContext - The details of the user that is to be authenticated.RemoteException - A communication error occurred - the Crowd server may not be available.InvalidAuthorizationTokenException - The application (not the user) was not authenticated correctly.InvalidAuthenticationException - The user was not successfully authenticated.InactiveAccountException - The user's account is inactive and they are not be allowed to authenticate.ApplicationAccessDeniedException - user does not have authorisation to access application.ExpiredCredentialException - The user's credentials have expired. The user must change their credentials in order to successfully authenticate.public String authenticateWithoutValidatingPassword(UserAuthenticationContext authenticationContext) throws ApplicationAccessDeniedException, InvalidAuthenticationException, InvalidAuthorizationTokenException, InactiveAccountException, RemoteException
AuthenticationManagerPrincipalAuthenticationContext contains the details of who they are
and where they're coming from but does not need to contain any credentials.authenticateWithoutValidatingPassword in interface AuthenticationManagerauthenticationContext - The details of the user that is to be authenticated. Username and validation factors are required.ApplicationAccessDeniedException - user does not have authorisation to access application.InvalidAuthenticationException - The user was not successfully authenticated.InvalidAuthorizationTokenException - The application (not the user) was not authenticated correctly.InactiveAccountException - The user's account is inactive and they are not be allowed to authenticate.RemoteException - A communication error occurred - the Crowd server may not be available.public String authenticate(String username, String password) throws RemoteException, InvalidAuthorizationTokenException, InvalidAuthenticationException, InactiveAccountException, ApplicationAccessDeniedException, ExpiredCredentialException
AuthenticationManagerauthenticate in interface AuthenticationManagerusername - username of user.password - credentials of user.RemoteException - A communication error occurred - the Crowd server may not be available.InvalidAuthorizationTokenException - The application (not the user) was not authenticated correctly.InvalidAuthenticationException - The user was not successfully authenticated.InactiveAccountException - The user's account is inactive and they are not be allowed to authenticate.ApplicationAccessDeniedException - user does not have authorisation to access application.ExpiredCredentialException - The user's credentials have expired.public boolean isAuthenticated(String token, ValidationFactor[] validationFactors) throws RemoteException, InvalidAuthorizationTokenException, ApplicationAccessDeniedException, InvalidAuthenticationException
AuthenticationManagerAuthenticationManager.authenticate(com.atlassian.crowd.model.authentication.UserAuthenticationContext) is still valid, given the validation factors.isAuthenticated in interface AuthenticationManagertoken - The token presented by the user as evidence of their authenticityvalidationFactors - Details of where the user's come from. If presented, must match those presented during
authentication.RemoteException - A communication error occurred - the Crowd server may not be available.InvalidAuthorizationTokenException - The application (not the user) was not authenticated correctly.ApplicationAccessDeniedException - user does not have authorisation to access application.InvalidAuthenticationException - The user was not successfully authenticated.public void invalidate(String token) throws RemoteException, InvalidAuthorizationTokenException, InvalidAuthenticationException
AuthenticationManagertoken as invalid, meaning that the principal it represents is no longer
authenticated. Usually used to make the user logged-off.invalidate in interface AuthenticationManagertoken - The token presented by the user, as returned from AuthenticationManager.authenticate(com.atlassian.crowd.model.authentication.UserAuthenticationContext)RemoteException - A communication error occurred - the Crowd server may not be available.InvalidAuthorizationTokenException - The application (not the user) was not authenticated correctly.InvalidAuthenticationException - The user was not successfully authenticated.public SecurityServerClient getSecurityServerClient()
AuthenticationManagerSecurityServerClient, for when you need more API access than the
authentication manager provides.getSecurityServerClient in interface AuthenticationManagerCopyright © 2023 Atlassian. All rights reserved.