|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.crowd.integration.http.CacheAwareCrowdHttpAuthenticator
public class CacheAwareCrowdHttpAuthenticator
CacheAwareCrowdHttpAuthenticator ensures that a user exists in the cache when a user is retrieved from the server or is authenticated.
Constructor Summary | |
---|---|
CacheAwareCrowdHttpAuthenticator(CrowdHttpAuthenticator delegate,
AuthenticatorUserCache userCache)
|
Method Summary | |
---|---|
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. |
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)
Tests whether a request is authenticated via SSO. |
void |
logout(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Logs out the authenticated user. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CacheAwareCrowdHttpAuthenticator(CrowdHttpAuthenticator delegate, AuthenticatorUserCache userCache)
Method Detail |
---|
public User getUser(javax.servlet.http.HttpServletRequest request) throws InvalidTokenException, InvalidAuthenticationException, ApplicationPermissionException, OperationFailedException
CrowdHttpAuthenticator
getUser
in interface CrowdHttpAuthenticator
request
- 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
CrowdHttpAuthenticator
authenticate
in interface CrowdHttpAuthenticator
request
- request to set the Crowd SSO tokenresponse
- response to set the Crowd SSO token cookieusername
- username to authenticatepassword
- password of the user
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.
InvalidTokenException
ApplicationAccessDeniedException
ExpiredCredentialException
InactiveAccountException
public User authenticateWithoutValidatingPassword(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String username) throws InvalidAuthenticationException, OperationFailedException, InvalidTokenException, ApplicationAccessDeniedException, ApplicationPermissionException, InactiveAccountException
CrowdHttpAuthenticator
authenticateWithoutValidatingPassword
in interface CrowdHttpAuthenticator
request
- request to set the Crowd SSO tokenresponse
- response to set the Crowd SSO token cookieusername
- username to authenticate
InvalidAuthenticationException
- 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.
InvalidTokenException
ApplicationAccessDeniedException
InactiveAccountException
public boolean isAuthenticated(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws OperationFailedException
CrowdHttpAuthenticator
isAuthenticated
in interface CrowdHttpAuthenticator
request
- HttpServletRequestresponse
- HttpServletResponse
true
if and only if the request has been authenticated.
OperationFailedException
- 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
CrowdHttpAuthenticator
logout
in interface CrowdHttpAuthenticator
request
- 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)
CrowdHttpAuthenticator
getToken
in interface CrowdHttpAuthenticator
request
- request to look for the Crowd SSO token.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |