Authentication 如何在SpringSecurityXML配置中为登录页面添加内容安全策略头?
我正在尝试为我的Spring web应用程序中的所有安全过滤器添加内容安全策略标题属性,我可以使用的Authentication 如何在SpringSecurityXML配置中为登录页面添加内容安全策略头?,authentication,tomcat,spring-security,content-security-policy,Authentication,Tomcat,Spring Security,Content Security Policy,我正在尝试为我的Spring web应用程序中的所有安全过滤器添加内容安全策略标题属性,我可以使用的headerselement标记在httpelement中为通用安全过滤器添加内容安全策略标题属性,但对于登录页面、css等的安全过滤器,我无法添加它们,因为如果http标记的security标记设置为“none”,则该标记中不允许任何元素。此外,如果我没有将其设置为“无”(以添加所需的标题),web应用程序将无法正确编译,并出现“未配置登录页面”错误。以下是我现在使用的配置: <htt
headers
element标记在http
element中为通用安全过滤器添加内容安全策略标题属性,但对于登录页面、css等的安全过滤器,我无法添加它们,因为如果http
标记的security
标记设置为“none”,则该标记中不允许任何元素。此外,如果我没有将其设置为“无”(以添加所需的标题),web应用程序将无法正确编译,并出现“未配置登录页面”错误。以下是我现在使用的配置:
<http pattern="/css/**" security="none"/>
<http pattern="/login.jsp*" security="none"/>
<http auto-config='true'>
<security:headers>
<security:header name="X-Content-Security-Policy" value="default-src 'self'"/>
<security:header name="X-WebKit-CSP" value="default-src 'self'"/>
</security:headers>
<intercept-url pattern="/**" access="ROLE_USER" />
<form-login login-page='/login.jsp'/>
</http>
我应该如何解决这个问题,我正在使用文档。谢谢