Class BroadleafAuthenticationFailureRedirectStrategy

java.lang.Object
org.broadleafcommerce.common.web.security.BroadleafAuthenticationFailureRedirectStrategy
All Implemented Interfaces:
org.springframework.security.web.RedirectStrategy

@Component("blAuthenticationFailureRedirectStrategy") public class BroadleafAuthenticationFailureRedirectStrategy extends Object implements org.springframework.security.web.RedirectStrategy
Extends the Spring DefaultRedirectStrategy with support for ajax redirects.

Designed for use with SpringSecurity when errors are present.

Tacks on the BLC_AJAX_PARAMETER=true to the redirect request if the request is an ajax request. This will cause the resulting controller (e.g. LoginController) to treat the request as if it is coming from Ajax and return the related page fragment rather than returning the full view of the page.

Author:
bpolster
  • Constructor Details

    • BroadleafAuthenticationFailureRedirectStrategy

      public BroadleafAuthenticationFailureRedirectStrategy()
  • Method Details

    • sendRedirect

      public void sendRedirect(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String url) throws IOException
      Specified by:
      sendRedirect in interface org.springframework.security.web.RedirectStrategy
      Throws:
      IOException
    • updateUrlForAjax

      public String updateUrlForAjax(String url)
    • getRedirectStrategy

      public org.springframework.security.web.RedirectStrategy getRedirectStrategy()
    • setRedirectStrategy

      public void setRedirectStrategy(org.springframework.security.web.RedirectStrategy redirectStrategy)