Class SecurePortalBeforeControllerHandler

java.lang.Object
de.hybris.platform.b2bacceleratoraddon.interceptors.SecurePortalBeforeControllerHandler
All Implemented Interfaces:
BeforeControllerHandler

public class SecurePortalBeforeControllerHandler extends Object implements BeforeControllerHandler
Intercepts incoming requests to check if the current site will require authentication or not. The site can be secured through the Backoffice by accessing the list of web sites and modifying the attribute requiresAuthentication.
  • Constructor Details

    • SecurePortalBeforeControllerHandler

      public SecurePortalBeforeControllerHandler()
  • Method Details

    • setCheckoutLoginUri

      public void setCheckoutLoginUri(String checkoutLoginUri)
    • setDefaultLoginUri

      public void setDefaultLoginUri(String defaultLoginUri)
    • setRedirectStrategy

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

      public void setSiteBaseUrlResolutionService(SiteBaseUrlResolutionService siteBaseUrlResolutionService)
    • setUnsecuredUris

      public void setUnsecuredUris(Set<String> unsecuredUris)
    • setControlUris

      public void setControlUris(Set<String> controlUris)
    • setCmsSiteService

      public void setCmsSiteService(CMSSiteService cmsSiteService)
    • setUserService

      public void setUserService(UserService userService)
    • setRequestProcessor

      public void setRequestProcessor(SecurePortalRequestProcessor requestProcessor)
    • getSessionService

      protected SessionService getSessionService()
    • setSessionService

      public void setSessionService(SessionService sessionService)
    • maintainFlashAttributes

      protected void maintainFlashAttributes(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
      Maintains flash attributes to prevent data such as global messages to be lost when you are redirected to the login page
      Parameters:
      request - Standard HTTP request
      response - Standard HTTP response
    • beforeController

      public boolean beforeController(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.web.method.HandlerMethod handler) throws Exception
      Description copied from interface: BeforeControllerHandler
      Called before the DispatcherServlet calls the controller.
      Specified by:
      beforeController in interface BeforeControllerHandler
      Parameters:
      request - current HTTP request
      response - current HTTP response
      Returns:
      true if the execution chain should proceed with the next interceptor or the handler itself. Else, DispatcherServlet assumes that this interceptor has already dealt with the response itself.
      Throws:
      Exception - in case of errors
    • isUserSoftLoggedIn

      protected boolean isUserSoftLoggedIn()
    • handleAnonymousNotLoginRequest

      protected boolean handleAnonymousNotLoginRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String otherRequestParam)
    • handleUriPartOfSet

      protected boolean handleUriPartOfSet(boolean isUserAnonymous, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String otherRequestParam)
    • isNotLoginRequest

      protected boolean isNotLoginRequest(javax.servlet.http.HttpServletRequest request)
    • isUriPartOfSet

      protected boolean isUriPartOfSet(javax.servlet.http.HttpServletRequest request, Set<String> inputSet)
    • isSiteSecured

      protected boolean isSiteSecured()
    • redirect

      protected void redirect(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String targetUrl)
    • getRedirectUrl

      protected String getRedirectUrl(String mapping, boolean secured, String otherParameters)
    • getRedirectUrlIfAuthenticated

      protected String getRedirectUrlIfAuthenticated(String otherParameters)
    • hackRefererHeader

      protected javax.servlet.http.HttpServletRequest hackRefererHeader(javax.servlet.http.HttpServletRequest request)
      Method to handle the case that the referer of the request is empty. The execution of this method could be switched off from project.properties.
    • isPreview

      protected boolean isPreview()
      Checks if we are in preview mode by checking the presence of a cmsTicketId in session.
      Returns:
      true if in preview mode