public class CacheAwareCrowdHttpAuthenticator extends Object implements CrowdHttpAuthenticator
| Constructor and Description |
|---|
CacheAwareCrowdHttpAuthenticator(CrowdHttpAuthenticator delegate,
AuthenticatorUserCache userCache) |
| Modifier and Type | Method and Description |
|---|---|
User |
authenticate(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String username,
String password)
Authenticates the user based on provided credentials.
|
User |
authenticateWithoutValidatingPassword(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String username)
Authenticates the user without validating password.
|
AuthenticationState |
checkAuthenticated(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Tests whether a request is authenticated via SSO.
|
String |
getToken(javax.servlet.http.HttpServletRequest request)
Retrieves the Crowd authentication token from the request.
|
User |
getUser(javax.servlet.http.HttpServletRequest request)
Attempts to retrieve the currently authenticated User from the request.
|
boolean |
isAuthenticated(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Deprecated.
|
void |
logout(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Logs out the authenticated user.
|
public CacheAwareCrowdHttpAuthenticator(CrowdHttpAuthenticator delegate, AuthenticatorUserCache userCache)
public User getUser(javax.servlet.http.HttpServletRequest request) throws InvalidTokenException, InvalidAuthenticationException, ApplicationPermissionException, OperationFailedException
CrowdHttpAuthenticatorgetUser in interface CrowdHttpAuthenticatorrequest - HTTP request, possibly containing a Crowd SSO cookie.User or null if the there is no authenticated user.InvalidTokenException - if the token in the request is not valid.InvalidAuthenticationException - if the application and password are not valid.ApplicationPermissionException - if the application is not permitted to perform the requested operation on the server.OperationFailedException - if the operation has failed for an unknown reason.public User authenticate(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String username, String password) throws InvalidTokenException, ApplicationAccessDeniedException, InvalidAuthenticationException, ExpiredCredentialException, ApplicationPermissionException, InactiveAccountException, OperationFailedException
CrowdHttpAuthenticatorValidation factors (such as IP address) are extracted from the request.
If the user is successfully authenticated, the Crowd SSO token is placed in:
If the credentials fail authentication, any existing Crowd SSO token is removed from:
authenticate in interface CrowdHttpAuthenticatorrequest - request to set the Crowd SSO tokenresponse - response to set the Crowd SSO token cookieusername - username to authenticatepassword - password of the userInvalidAuthenticationException - if the application and password are not valid.ApplicationPermissionException - if the application is not permitted to perform the requested operation on the server.OperationFailedException - if the operation has failed for an unknown reason.InvalidTokenExceptionApplicationAccessDeniedExceptionExpiredCredentialExceptionInactiveAccountExceptionpublic User authenticateWithoutValidatingPassword(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String username) throws InvalidAuthenticationException, OperationFailedException, InvalidTokenException, ApplicationAccessDeniedException, ApplicationPermissionException, InactiveAccountException
CrowdHttpAuthenticatorValidation factors (such as IP address) are extracted from the request.
If the user is successfully authenticated, the Crowd SSO token is placed in:
If authentication fails, any existing Crowd SSO token is removed from:
authenticateWithoutValidatingPassword in interface CrowdHttpAuthenticatorrequest - request to set the Crowd SSO tokenresponse - response to set the Crowd SSO token cookieusername - username to authenticateInvalidAuthenticationException - if the application and password are not valid.OperationFailedException - if the operation has failed for an unknown reason.ApplicationPermissionException - if the application is not permitted to perform the requested operation on the server.InvalidTokenExceptionApplicationAccessDeniedExceptionInactiveAccountException@Deprecated public boolean isAuthenticated(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws OperationFailedException
CrowdHttpAuthenticatorisAuthenticated in interface CrowdHttpAuthenticatorrequest - HttpServletRequestresponse - HttpServletResponsetrue if and only if the request has been authenticated.OperationFailedException - if the operation has failed for an unknown reason.public AuthenticationState checkAuthenticated(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws OperationFailedException
CrowdHttpAuthenticatorcheckAuthenticated in interface CrowdHttpAuthenticatorrequest - HttpServletRequestresponse - HttpServletResponseOperationFailedException - if the operation has failed for an unknown reason.public void logout(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws InvalidAuthenticationException,
ApplicationPermissionException,
OperationFailedException
CrowdHttpAuthenticatorlogout in interface CrowdHttpAuthenticatorrequest - request contains the Crowd SSO token to invalidate and hence log the user out.response - response returns a request to remove the token cookie from the user browser.InvalidAuthenticationException - if the application and password are not valid.ApplicationPermissionException - if the application is not permitted to perform the requested operation on the server.OperationFailedException - if the operation has failed for an unknown reason.public String getToken(javax.servlet.http.HttpServletRequest request)
CrowdHttpAuthenticatorgetToken in interface CrowdHttpAuthenticatorrequest - request to look for the Crowd SSO token.Copyright © 2019 Atlassian. All rights reserved.