Interface AuthenticationFeedbackHandler
- All Known Implementing Classes:
AbstractAuthenticationHandler
,DefaultAuthenticationFeedbackHandler
AuthenticationFeedbackHandler
may be implemented by
AuthenticationHandler
services to request being informed on the
success or failure of authentication.-
Method Summary
Modifier and TypeMethodDescriptionvoid
authenticationFailed
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, AuthenticationInfo authInfo) Called if authentication failed with the credentials provided in theauthInfo
map.boolean
authenticationSucceeded
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, AuthenticationInfo authInfo) Called if authentication succeeded with the credentials provided in theauthInfo
map.
-
Method Details
-
authenticationFailed
void authenticationFailed(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, AuthenticationInfo authInfo) Called if authentication failed with the credentials provided in theauthInfo
map.This method allows the handler to cleanup any state prepared while handling the
extractCredentials
method. Handlers are expected to not send a in this method because the Sling Authenticator will proceed to select an authentication handler whoserequestCredentials
method will be called.Implementations may also wish to set the
AuthenticationHandler.FAILURE_REASON
request attribute to inform interested parties (including its anyAuthenticationHandler.requestCredentials(HttpServletRequest, HttpServletResponse)
method about the reasons of failure to to authenticate.- Parameters:
request
- The current requestresponse
- The current responseauthInfo
- TheAuthenticationInfo
object used to authenticate the request.
-
authenticationSucceeded
boolean authenticationSucceeded(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, AuthenticationInfo authInfo) Called if authentication succeeded with the credentials provided in theauthInfo
map.This method is called after successful login and impersonation handling immediately before continuing with the request. The handler may choose to send its own response or to just set some response header (e.g. adding a Cookie) and return appropriately.
- Parameters:
request
- The current requestresponse
- The current responseauthInfo
- TheAuthenticationInfo
object used to authenticate the request.- Returns:
true
if the handler sent back a response to the client and request processing should be terminated at this point. Iffalse
is returned, the request proceeds as authenticated.
-