Class VaadinSavedRequestAwareAuthenticationSuccessHandler

  • All Implemented Interfaces:
    org.springframework.security.web.authentication.AuthenticationSuccessHandler

    public class VaadinSavedRequestAwareAuthenticationSuccessHandler
    extends org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler
    A version of SavedRequestAwareAuthenticationSuccessHandler that writes a different return value for a Fusion TypeScript client.

    This class acts as a SavedRequestAwareAuthenticationSuccessHandler unless the request from the client contains a "source: typescript" header.

    If the header is present, it sends a return value that is an "ok" instead of a "redirect" response. This is so that the TypeScript caller is able to read the returned values. Additionally it sends the saved URL separately so the client can decide where to redirect if no URL was saved.

    • Field Summary

      • Fields inherited from class org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler

        logger
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void onAuthenticationSuccess​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.security.core.Authentication authentication)  
      void setRequestCache​(org.springframework.security.web.savedrequest.RequestCache requestCache)  
      • Methods inherited from class org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler

        clearAuthenticationAttributes
      • Methods inherited from class org.springframework.security.web.authentication.AbstractAuthenticationTargetUrlRequestHandler

        determineTargetUrl, determineTargetUrl, getDefaultTargetUrl, getRedirectStrategy, getTargetUrlParameter, handle, isAlwaysUseDefaultTargetUrl, setAlwaysUseDefaultTargetUrl, setDefaultTargetUrl, setRedirectStrategy, setTargetUrlParameter, setUseReferer
      • Methods inherited from interface org.springframework.security.web.authentication.AuthenticationSuccessHandler

        onAuthenticationSuccess
    • Constructor Detail

      • VaadinSavedRequestAwareAuthenticationSuccessHandler

        public VaadinSavedRequestAwareAuthenticationSuccessHandler()
        Creates a new instance.
    • Method Detail

      • onAuthenticationSuccess

        public void onAuthenticationSuccess​(javax.servlet.http.HttpServletRequest request,
                                            javax.servlet.http.HttpServletResponse response,
                                            org.springframework.security.core.Authentication authentication)
                                     throws javax.servlet.ServletException,
                                            IOException
        Specified by:
        onAuthenticationSuccess in interface org.springframework.security.web.authentication.AuthenticationSuccessHandler
        Overrides:
        onAuthenticationSuccess in class org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler
        Throws:
        javax.servlet.ServletException
        IOException
      • setRequestCache

        public void setRequestCache​(org.springframework.security.web.savedrequest.RequestCache requestCache)
        Overrides:
        setRequestCache in class org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler