Class SecurePortalAuthenticationInterceptor

java.lang.Object
de.hybris.platform.commercewebservicescommons.interceptor.SecurePortalAuthenticationInterceptor
All Implemented Interfaces:
org.springframework.web.servlet.HandlerInterceptor

public class SecurePortalAuthenticationInterceptor extends Object implements org.springframework.web.servlet.HandlerInterceptor
Default interceptor to run before controllers' execution to check if the current user is authenticated to access some secure portals when the requiresAuthentication enable on current BaseSite.
  • Constructor Details

    • SecurePortalAuthenticationInterceptor

      public SecurePortalAuthenticationInterceptor(BaseSiteService baseSiteService, UserService userService)
  • Method Details

    • preHandle

      public boolean preHandle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object handler) throws Exception
      Adds the base site and user to the session. When the current base site enable the requiresAuthentication flag the interceptor will check if the secure portal has @SecurePortalUnauthenticatedAccess annotation, if not, then for unauthenticated user we return an error in the HTTP response using the status code 404.
      Specified by:
      preHandle in interface org.springframework.web.servlet.HandlerInterceptor
      Throws:
      Exception
    • isSiteRequireAuthentication

      protected boolean isSiteRequireAuthentication()
    • isUnAuthenticatedUser

      protected boolean isUnAuthenticatedUser()
    • isAllowUnauthenticatedAccess

      protected boolean isAllowUnauthenticatedAccess(Object handler)
    • isAnonymousUser

      protected boolean isAnonymousUser(UserModel user)
    • isGuestUser

      protected boolean isGuestUser(UserModel user)