【发布时间】:2018-12-19 19:10:00
【问题描述】:
我正在使用 Liferay 6.2-ce-ga3、primefaces 6 和 JSF2.1。我已经为我的 portlet 启用了 CSRF 保护,在 liferay portal-ext.properties 和 portlet portal-ext.properties 中添加了以下代码:
auth.token.check.enabled=true
auth.token.impl=com.liferay.portal.security.auth.SessionAuthToken
此外,我已经在 portlet.xml 中添加了
<init-param>
<name>check-auth-token</name>
<value>true</value>
</init-param>
为了测试,我从我的form 网址中删除了p_auth=<code>,然后我提交了表单并且它有效。这不好,我不应该允许没有令牌的请求。
- 我忘记在配置中添加过滤器了吗?
- liferay 如何检查 p_auth?
- 我应该像 tutorial 这样在我的 bean 中手动检查 p_auth 令牌吗?
【问题讨论】:
-
请检查
auth.token.ignore.actions是否存在 -
@AndreAlbert 我没有手动创建该属性,是自动创建的吗?
-
@cheloncio,是你的请求和Ajax请求吗?
-
@stiemannkj1 java 请求
-
@cheloncio,这没有回答我的问题。您可以添加视图 xhtml 代码和步骤来重现您的问题吗?
标签: security jsf-2 liferay csrf liferay-6