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 Summary
ConstructorsConstructorDescriptionSecurePortalAuthenticationInterceptor(BaseSiteService baseSiteService, UserService userService) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanisAllowUnauthenticatedAccess(Object handler) protected booleanisAnonymousUser(UserModel user) protected booleanisGuestUser(UserModel user) protected booleanprotected booleanbooleanpreHandle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object handler) Adds the base site and user to the session.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.web.servlet.HandlerInterceptor
afterCompletion, postHandle
-
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:
preHandlein interfaceorg.springframework.web.servlet.HandlerInterceptor- Throws:
Exception
-
isSiteRequireAuthentication
protected boolean isSiteRequireAuthentication() -
isUnAuthenticatedUser
protected boolean isUnAuthenticatedUser() -
isAllowUnauthenticatedAccess
-
isAnonymousUser
-
isGuestUser
-