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

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

public class HeaderBasedAuthenticationSuccessHandler
extends Object
implements org.springframework.security.web.authentication.AuthenticationSuccessHandler

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


Constructor Summary
HeaderBasedAuthenticationSuccessHandler()
           
 
Method Summary
 void onAuthenticationSuccess(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.security.core.Authentication authentication)
           
 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

HeaderBasedAuthenticationSuccessHandler

public HeaderBasedAuthenticationSuccessHandler()
Method Detail

onAuthenticationSuccess

public void onAuthenticationSuccess(javax.servlet.http.HttpServletRequest request,
                                    javax.servlet.http.HttpServletResponse response,
                                    org.springframework.security.core.Authentication authentication)
                             throws IOException,
                                    javax.servlet.ServletException
Specified by:
onAuthenticationSuccess in interface org.springframework.security.web.authentication.AuthenticationSuccessHandler
Parameters:
request -
response -
authentication -
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.