< form:form>在JSTL中是否包含CSRF?(春季安全) [英] <form:form> in JSTL have CSRF included? (Spring security)

查看:50
本文介绍了< form:form>在JSTL中是否包含CSRF?(春季安全)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了一个教程,该教程使用自定义表单来处理Spring Security中的登录,并且在某个时候该教程做出了这样的声明:

I came across with a tutorial to handle logins in Spring Security with custom forms and at some point the tutorial make this statement:

如果我们使用的是Spring < form:form> ,则无需添加标签用于CSRF.

In case we are using spring <form:form>, we need not to include tag for CSRF.

为什么不需要将CSRF与JSTL中的表单一起使用?

Why there is no need to use CSRF with forms in JSTL?

希望您能提供帮助,因为CSRF的文档记录不充分或至少没有得到很好的解释.

Hope you can help, beacuse CSRF is not that well documented or at least not well explained.

推荐答案

< form:form> 是使用jsp时的spring标记,这意味着它们已经在照顾csfr,如果它们的自己的标签.直接来自他们的文档:

<form:form> is the spring tag when using jsp which implies they are already taking care for the csfr if its their own tag. Straight from their documentation:

如果您使用的是Spring MVC标签或Thymeleaf 2.1+,并且使用@ EnableWebSecurity,CsrfToken会自动包含在您(使用CsrfRequestDataValueProcessor).链接

这篇关于&lt; form:form&gt;在JSTL中是否包含CSRF?(春季安全)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆