Class CsrfFilter
java.lang.Object
org.springframework.web.filter.GenericFilterBean
org.broadleafcommerce.common.security.handler.CsrfFilter
- 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.EnvironmentAware,org.springframework.core.env.EnvironmentCapable,org.springframework.web.context.ServletContextAware
Deprecated.
Checks the validity of the CSRF token on every POST request.
You can inject excluded Request URI patterns to bypass this filter.
This filter uses the AntPathRequestMatcher which compares a pre-defined ant-style pattern against the URL
(
servletPath + pathInfo) of an HttpServletRequest.
This allows you to use wildcard matching as well, for example /** or **- Author:
- Andre Azzolini (apazzolini)
- See Also:
-
AntPathRequestMatcher
-
Field Summary
FieldsModifier and TypeFieldDescriptionDeprecated.protected ExploitProtectionServiceDeprecated.protected static final org.apache.commons.logging.LogDeprecated.Fields inherited from class org.springframework.web.filter.GenericFilterBean
logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddoFilter(jakarta.servlet.ServletRequest baseRequest, jakarta.servlet.ServletResponse baseResponse, jakarta.servlet.FilterChain chain) Deprecated.Deprecated.voidsetExcludedRequestPatterns(List<String> excludedRequestPatterns) Deprecated.This allows you to declaratively set a list of excluded Request Patterns/exclude-me/** Methods inherited from class org.springframework.web.filter.GenericFilterBean
addRequiredProperty, afterPropertiesSet, createEnvironment, destroy, getEnvironment, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext
-
Field Details
-
LOG
protected static final org.apache.commons.logging.Log LOGDeprecated. -
exploitProtectionService
@Autowired @Qualifier("blExploitProtectionService") protected ExploitProtectionService exploitProtectionServiceDeprecated. -
excludedRequestPatterns
Deprecated.
-
-
Constructor Details
-
CsrfFilter
public CsrfFilter()Deprecated.
-
-
Method Details
-
doFilter
public void doFilter(jakarta.servlet.ServletRequest baseRequest, jakarta.servlet.ServletResponse baseResponse, jakarta.servlet.FilterChain chain) throws IOException, jakarta.servlet.ServletException Deprecated.- Throws:
IOExceptionjakarta.servlet.ServletException
-
getExcludedRequestPatterns
Deprecated. -
setExcludedRequestPatterns
Deprecated.This allows you to declaratively set a list of excluded Request Patterns/exclude-me/**
-
SecurityFilterinstead