public class DefaultAuthenticationFeedbackHandler extends java.lang.Object implements AuthenticationFeedbackHandler
Constructor and Description |
---|
DefaultAuthenticationFeedbackHandler() |
Modifier and Type | Method and Description |
---|---|
void |
authenticationFailed(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
AuthenticationInfo authInfo)
This default implementation does nothing.
|
boolean |
authenticationSucceeded(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
AuthenticationInfo authInfo)
This default implementation calls the
handleRedirect(HttpServletRequest, HttpServletResponse) method
to optionally redirect the request after successful authentication. |
static boolean |
handleRedirect(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handles an optional request for a redirect after successful
authentication and
true if the request has been redirected. |
public DefaultAuthenticationFeedbackHandler()
public static boolean handleRedirect(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
true
if the request has been redirected.
This method checks AuthenticationSupport.REDIRECT_PARAMETER
request parameter for the redirect target. This parameter is handled
as follows:
false
is returned.true
or is empty, a
redirect response to the request URI (HttpServletRequest.getRequestURI()
)
is sent and true
is returned.HttpServletRequest.getRequestURI()
). The resulting
target is validated with the
AbstractAuthenticationHandler.isRedirectValid(HttpServletRequest, String)
method. If valid a redirect to that target is sent back and true
is returned. Otherwise a redirect to the servlet context root is
sent back and true
is returned.AbstractAuthenticationHandler.isRedirectValid(HttpServletRequest, String)
method. If valid a redirect to that path is sent back and true
is returned. Otherwise a redirect to the servlet context root is
sent back and true
is returned.true
if redirect was requested. Otherwise
false
is returned. Note, that true
is
returned regardless of whether sending the redirect response
succeeded or not.AbstractAuthenticationHandler.isRedirectValid(HttpServletRequest, String)
method.public void authenticationFailed(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, AuthenticationInfo authInfo)
Extensions of this class may overwrite to cleanup any internal state.
authenticationFailed
in interface AuthenticationFeedbackHandler
request
- The current requestresponse
- The current responseauthInfo
- The AuthenticationInfo
object used to
authenticate the request.public boolean authenticationSucceeded(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, AuthenticationInfo authInfo)
handleRedirect(HttpServletRequest, HttpServletResponse)
method
to optionally redirect the request after successful authentication.
Extensions of this class may overwrite this method to perform additional cleanup etc.
authenticationSucceeded
in interface AuthenticationFeedbackHandler
request
- The current requestresponse
- The current responseauthInfo
- The AuthenticationInfo
object used to
authenticate the request.handleRedirect(HttpServletRequest, HttpServletResponse)
method.Copyright © 2018 The Apache Software Foundation. All rights reserved.