Class ConfigAwarePreAuthenticationFilter
java.lang.Object
org.springframework.web.filter.GenericFilterBean
org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter
org.craftercms.engine.util.spring.security.ConfigAwarePreAuthenticationFilter
- All Implemented Interfaces:
jakarta.servlet.Filter,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.InitializingBean,org.springframework.context.ApplicationEventPublisherAware,org.springframework.context.EnvironmentAware,org.springframework.core.env.EnvironmentCapable,org.springframework.web.context.ServletContextAware
- Direct Known Subclasses:
TargetingPreAuthenticatedFilter
public abstract class ConfigAwarePreAuthenticationFilter
extends org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter
Extension of
AbstractPreAuthenticatedProcessingFilter that uses site config to enable processing:
- If
alwaysEnabledistruethe filter will be executed, even if there is no site configuration available - If the site configuration contains the
enabledConfigKeywith a value oftruethe filter will be executed
supportedPrincipalClass the
filter will not be executed- Since:
- 3.1.5
- Author:
- joseross
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected Stringprotected Class<? extends org.springframework.security.core.userdetails.UserDetails> Fields inherited from class org.springframework.web.filter.GenericFilterBean
logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddoFilter(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response, jakarta.servlet.FilterChain chain) protected ObjectgetPreAuthenticatedCredentials(jakarta.servlet.http.HttpServletRequest request) booleanprotected booleanprincipalChanged(jakarta.servlet.http.HttpServletRequest request, org.springframework.security.core.Authentication currentAuthentication) voidsetAlwaysEnabled(boolean alwaysEnabled) voidsetSupportedPrincipalClass(Class<? extends org.springframework.security.core.userdetails.UserDetails> supportedPrincipalClass) Methods inherited from class org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter
afterPropertiesSet, getAuthenticationDetailsSource, getPreAuthenticatedPrincipal, setApplicationEventPublisher, setAuthenticationDetailsSource, setAuthenticationFailureHandler, setAuthenticationManager, setAuthenticationSuccessHandler, setCheckForPrincipalChanges, setContinueFilterChainOnUnsuccessfulAuthentication, setInvalidateSessionOnPrincipalChange, setRequiresAuthenticationRequestMatcher, setSecurityContextHolderStrategy, setSecurityContextRepository, successfulAuthentication, unsuccessfulAuthenticationMethods inherited from class org.springframework.web.filter.GenericFilterBean
addRequiredProperty, createEnvironment, destroy, getEnvironment, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext
-
Field Details
-
alwaysEnabled
protected boolean alwaysEnabled -
enabledConfigKey
-
supportedPrincipalClass
protected Class<? extends org.springframework.security.core.userdetails.UserDetails> supportedPrincipalClass
-
-
Constructor Details
-
ConfigAwarePreAuthenticationFilter
-
-
Method Details
-
setAlwaysEnabled
public void setAlwaysEnabled(boolean alwaysEnabled) -
setSupportedPrincipalClass
public void setSupportedPrincipalClass(Class<? extends org.springframework.security.core.userdetails.UserDetails> supportedPrincipalClass) -
isEnabled
public boolean isEnabled() -
doFilter
public void doFilter(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response, jakarta.servlet.FilterChain chain) throws IOException, jakarta.servlet.ServletException - Specified by:
doFilterin interfacejakarta.servlet.Filter- Overrides:
doFilterin classorg.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter- Throws:
IOExceptionjakarta.servlet.ServletException
-
principalChanged
protected boolean principalChanged(jakarta.servlet.http.HttpServletRequest request, org.springframework.security.core.Authentication currentAuthentication) - Overrides:
principalChangedin classorg.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter
-
getPreAuthenticatedCredentials
- Specified by:
getPreAuthenticatedCredentialsin classorg.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter
-