Package io.meeds.spring.web.security
Class PortalRememberMeFilter
java.lang.Object
org.exoplatform.container.web.AbstractFilter
io.meeds.spring.web.security.PortalRememberMeFilter
- All Implemented Interfaces:
jakarta.servlet.Filter
public class PortalRememberMeFilter
extends org.exoplatform.container.web.AbstractFilter
A Web filter to authenticate user Identity using 'rememberme' cookie if
present.
The cookie token is validated by
Nothing here ever deletes the remember-me cookie: the token store is the source of truth for a token's validity, and a failure reaching this filter says nothing about the token — it is internal, or the user was removed since the token was issued.
Note: added to be included in class packages scan for Spring
The cookie token is validated by
CookieTokenService; a valid token is
a pre-authentication: the user is authenticated on the Spring Security
side with a PreAuthenticatedAuthenticationToken and the resulting
SecurityContext is saved in the HTTP session, so that the following
requests of the same session are authenticated without re-reading the
cookie. No password login is attempted through the Servlet API: on a Spring
WAR, HttpServletRequest.login(String, String) is intercepted by
Spring Security and routed to the AuthenticationManager as a
UsernamePasswordAuthenticationToken, which
PortalAuthenticationManager deliberately does not support.Nothing here ever deletes the remember-me cookie: the token store is the source of truth for a token's validity, and a failure reaching this filter says nothing about the token — it is internal, or the user was removed since the token was issued.
Note: added to be included in class packages scan for Spring
-
Field Summary
Fields inherited from class org.exoplatform.container.web.AbstractFilter
config, servletContextName -
Constructor Summary
ConstructorsConstructorDescriptionPortalRememberMeFilter(org.springframework.security.authentication.AuthenticationProvider authenticationProvider) -
Method Summary
Modifier and TypeMethodDescriptionvoiddoFilter(jakarta.servlet.ServletRequest req, jakarta.servlet.ServletResponse resp, jakarta.servlet.FilterChain chain) Methods inherited from class org.exoplatform.container.web.AbstractFilter
afterInit, getContainer, getServletContext, init, requirePortalEnvironmentMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jakarta.servlet.Filter
destroy
-
Constructor Details
-
PortalRememberMeFilter
public PortalRememberMeFilter(org.springframework.security.authentication.AuthenticationProvider authenticationProvider)
-
-
Method Details
-
doFilter
public void doFilter(jakarta.servlet.ServletRequest req, jakarta.servlet.ServletResponse resp, jakarta.servlet.FilterChain chain) throws IOException, jakarta.servlet.ServletException - Throws:
IOExceptionjakarta.servlet.ServletException
-