org.apache.sling.auth.core.spi
Class DefaultAuthenticationFeedbackHandler

java.lang.Object
  extended by org.apache.sling.auth.core.spi.DefaultAuthenticationFeedbackHandler
All Implemented Interfaces:
AuthenticationFeedbackHandler
Direct Known Subclasses:
AbstractAuthenticationHandler

public class DefaultAuthenticationFeedbackHandler
extends Object
implements AuthenticationFeedbackHandler


Constructor Summary
DefaultAuthenticationFeedbackHandler()
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultAuthenticationFeedbackHandler

public DefaultAuthenticationFeedbackHandler()
Method Detail

handleRedirect

public 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.

If sending the redirect response fails due to some IO problems, the request is still terminated but an error message is logged indicating the problem.

Returns:
true if redirect was requested. Otherwise false is returned. Note, that true is returned regardless of whether sending the redirect response succeeded or not.

authenticationFailed

public void authenticationFailed(javax.servlet.http.HttpServletRequest request,
                                 javax.servlet.http.HttpServletResponse response,
                                 AuthenticationInfo authInfo)
This default implementation does nothing.

Extensions of this class may overwrite to cleanup any internal state.

Specified by:
authenticationFailed in interface AuthenticationFeedbackHandler
Parameters:
request - The current request
response - The current response
authInfo - The AuthenticationInfo object used to authenticate the request.

authenticationSucceeded

public 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.

Extensions of this class may overwrite this method to perform additional cleanup etc.

Specified by:
authenticationSucceeded in interface AuthenticationFeedbackHandler
Parameters:
request - The current request
response - The current response
authInfo - The AuthenticationInfo object used to authenticate the request.
Returns:
the result of calling the handleRedirect(HttpServletRequest, HttpServletResponse) method.


Copyright © 2007-2011 The Apache Software Foundation. All Rights Reserved.