@Transactional(propagation=NOT_SUPPORTED) public class RetryingTokenAuthenticationManager extends DelegatingTokenAuthenticationManager
TokenAuthenticationManagerImpl
by retrying authentications that fail due to a
concurrent authentication creating a token.Constructor and Description |
---|
RetryingTokenAuthenticationManager(TokenAuthenticationManager delegate,
int retryCount) |
Modifier and Type | Method and Description |
---|---|
Token |
authenticateApplication(Application application,
ApplicationAuthenticationContext authenticationContext,
TokenLifetime tokenLifetime)
Authenticates an application and generates an authentication token.
|
Token |
authenticateApplicationWithoutValidatingPassword(Application application,
ApplicationAuthenticationContext authenticationContext,
TokenLifetime tokenLifetime)
Authenticates an application and generates an authentication token, ignoring the credentials.
|
Token |
authenticateUser(Application application,
UserAuthenticationContext authenticateContext,
TokenLifetime tokenLifetime)
Authenticates a user and and generates an authentication token.
|
Token |
authenticateUserWithoutValidatingPassword(Application application,
UserAuthenticationContext authenticateContext)
Feigns the authentication process for a user and creates a token for the authentication without validating the password.
|
findAuthorisedApplications, findUserByToken, findUserTokenByKey, getTokenExpiryTime, invalidateAllTokens, invalidateToken, invalidateTokensForUser, removeExpiredTokens, validateApplicationToken, validateUserToken
public RetryingTokenAuthenticationManager(TokenAuthenticationManager delegate, int retryCount)
public Token authenticateApplication(Application application, ApplicationAuthenticationContext authenticationContext, TokenLifetime tokenLifetime) throws InvalidAuthenticationException
TokenAuthenticationManager
authenticateApplication
in interface TokenAuthenticationManager
authenticateApplication
in class DelegatingTokenAuthenticationManager
application
- the application being authenticatedauthenticationContext
- application authentication credentials.tokenLifetime
- Requested lifetime of the tokenInvalidAuthenticationException
- authentication was not successful because either the application does not exist, the password is incorrect, the application is inactive or there was a problem generating the authentication token.public Token authenticateApplicationWithoutValidatingPassword(Application application, ApplicationAuthenticationContext authenticationContext, TokenLifetime tokenLifetime) throws InvalidAuthenticationException
TokenAuthenticationManager
This method should only be used to generate a token for an application that has already authenticated via some other means (eg. TLS client certificates) as this method bypasses any password checks.
authenticateApplicationWithoutValidatingPassword
in interface TokenAuthenticationManager
authenticateApplicationWithoutValidatingPassword
in class DelegatingTokenAuthenticationManager
application
- the application being authenticatedauthenticationContext
- application authentication credentials.tokenLifetime
- Requested lifetime of the tokenInvalidAuthenticationException
- authentication was not successful because either the application does not exist, the application is inactive or there was a problem generating the authentication token.public Token authenticateUser(Application application, UserAuthenticationContext authenticateContext, TokenLifetime tokenLifetime) throws InvalidAuthenticationException, OperationFailedException, InactiveAccountException, ApplicationAccessDeniedException, ExpiredCredentialException
TokenAuthenticationManager
The RemoteDirectory.authenticate(String, com.atlassian.crowd.embedded.api.PasswordCredential)
method is
iteratively called for each assigned directory. If the user does not exist in one directory, the directory is skipped and the next one is examined. If the user does
not exist in any of the assigned directories then an InvalidAuthenticationException
is thrown.
authenticateUser
in interface TokenAuthenticationManager
authenticateUser
in class DelegatingTokenAuthenticationManager
authenticateContext
- The authentication details for the user.tokenLifetime
- Requested lifetime of the tokenInvalidAuthenticationException
- The authentication was not successful.OperationFailedException
- error thrown by directory implementation when attempting to find or authenticate the user.InactiveAccountException
- user account is inactive.ApplicationAccessDeniedException
- user does not have access to authenticate with application.ExpiredCredentialException
- the user's credentials have expired. The user must change their credentials in order to successfully authenticate.public Token authenticateUserWithoutValidatingPassword(Application application, UserAuthenticationContext authenticateContext) throws InvalidAuthenticationException, OperationFailedException, InactiveAccountException, ApplicationAccessDeniedException
TokenAuthenticationManager
This method should only be used to generate a token for a user that has already authenticated credentials via some other means (eg. SharePoint NTLM connector) as this method bypasses any password checks.
If you want actual password authentication, use the TokenAuthenticationManager.authenticateUser(Application, UserAuthenticationContext, TokenLifetime)
method.
authenticateUserWithoutValidatingPassword
in interface TokenAuthenticationManager
authenticateUserWithoutValidatingPassword
in class DelegatingTokenAuthenticationManager
authenticateContext
- The authentication details for the user.InvalidAuthenticationException
- if the authentication was not successful.OperationFailedException
- if the error thrown by directory implementation when attempting to find or authenticate the user.InactiveAccountException
- if the user account is inactive.ApplicationAccessDeniedException
- if the user does not have access to authenticate with application.Copyright © 2021 Atlassian. All rights reserved.