org.bbqjs.spring.security.web.authentication
Class HeaderBasedAuthenticationFailureHandler

java.lang.Object
  extended by org.bbqjs.spring.security.web.authentication.HeaderBasedAuthenticationFailureHandler
All Implemented Interfaces:
org.springframework.security.web.authentication.AuthenticationFailureHandler

public class HeaderBasedAuthenticationFailureHandler
extends Object
implements org.springframework.security.web.authentication.AuthenticationFailureHandler

Sends a X-BBQ-ResponseType header with the value 0 and writes {result: false} into the output stream. The header names and values and response JSON are overridable.


Constructor Summary
HeaderBasedAuthenticationFailureHandler()
           
 
Method Summary
 void onAuthenticationFailure(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.security.core.AuthenticationException exception)
           
 void setResponseCode(int responseCode)
           
 void setResponseJSON(String responseJSON)
           
 void setResponseMessage(String responseMessage)
           
 void setResponseMessageHeader(String responseMessageHeader)
           
 void setResponseTypeHeader(String responseTypeHeader)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HeaderBasedAuthenticationFailureHandler

public HeaderBasedAuthenticationFailureHandler()
Method Detail

onAuthenticationFailure

public void onAuthenticationFailure(javax.servlet.http.HttpServletRequest request,
                                    javax.servlet.http.HttpServletResponse response,
                                    org.springframework.security.core.AuthenticationException exception)
                             throws IOException,
                                    javax.servlet.ServletException
Specified by:
onAuthenticationFailure in interface org.springframework.security.web.authentication.AuthenticationFailureHandler
Parameters:
request -
response -
exception -
Throws:
IOException
javax.servlet.ServletException

setResponseTypeHeader

public void setResponseTypeHeader(String responseTypeHeader)

setResponseCode

public void setResponseCode(int responseCode)

setResponseMessageHeader

public void setResponseMessageHeader(String responseMessageHeader)

setResponseMessage

public void setResponseMessage(String responseMessage)

setResponseJSON

public void setResponseJSON(String responseJSON)


Copyright © 2012. All Rights Reserved.