Liferay 7.3 LoginPortlet上不需要的CSRF验证
用户使用门户LoginPortlet执行登录后,登录失败,并在日志中打印警告:Liferay 7.3 LoginPortlet上不需要的CSRF验证,liferay,csrf,liferay-7,liferay-7.3,Liferay,Csrf,Liferay 7,Liferay 7.3,用户使用门户LoginPortlet执行登录后,登录失败,并在日志中打印警告: 不允许用户0访问URLhttp://localhost:8080/web/guest/login 和portlet com\u liferay\u login\u web\u portlet\u LoginPortlet:用户0未为com.liferay.portlet.SecurityPortletContainerRapper提供有效的CSRF令牌 第二次登录后,登录正常。只有在登录页面打开几分钟并且身份验证令牌
不允许用户0访问URLhttp://localhost:8080/web/guest/login 和portlet com\u liferay\u login\u web\u portlet\u LoginPortlet:用户0未为com.liferay.portlet.SecurityPortletContainerRapper提供有效的CSRF令牌
第二次登录后,登录正常。只有在登录页面打开几分钟并且身份验证令牌失效时,才会出现问题。这基本上没有问题,但是portal config
portlet.add.default.resource.check.whitelist
有一个LoginPortlet的排除项。但这个白名单似乎无法避免不必要的检查。是否还有其他地方可以避免CSRF检查LoginPortlet?我无法重现此问题,我使用此服务器进行测试:Liferay社区版门户7.3.5 CE GA6
以下是我的步骤,请让我知道我应该改变什么来体验这个问题:
liferay-ce-portal-tomcat-7.3.5-ga6-20200930172312275.tar.gz
结果:
我可以成功登录,CSRF没有错误
一些建议:
A.在中搜索CSRF:
并查看是否可以找到解决问题的属性
这些属性可以是:
auth.token.impl=com.liferay.portal.security.auth.SessionAuthToken
auth.token.check.enabled=false
auth.token.ignore.origins
B.也许您可以尝试在您的portal-ext.properties中设置类似的内容:
portlet.add.default.resource.check.whitelist.actions=/login/login
C.您可以在Liferay Jira中进行搜索,例如,此票证讨论了类似的内容:
我无法重现此问题,我使用此服务器进行测试:
Liferay社区版门户7.3.5 CE GA6
以下是我的步骤,请让我知道我应该改变什么来体验这个问题:
liferay-ce-portal-tomcat-7.3.5-ga6-20200930172312275.tar.gz
结果:
我可以成功登录,CSRF没有错误
一些建议:
A.在中搜索CSRF:
并查看是否可以找到解决问题的属性
这些属性可以是:
auth.token.impl=com.liferay.portal.security.auth.SessionAuthToken
auth.token.check.enabled=false
auth.token.ignore.origins
B.也许您可以尝试在您的portal-ext.properties中设置类似的内容:
portlet.add.default.resource.check.whitelist.actions=/login/login
C.您可以在Liferay Jira中进行搜索,例如,此票证讨论了类似的内容:
谢谢@Peter Grabowski的回复。我可以通过在门户属性中添加
auth.token.ignore.portlets=com\u liferay\u login\u web\u portlet\u LoginPortlet
来解决我的问题谢谢@Peter Grabowski的回复。我可以通过在门户属性中添加auth.token.ignore.portlets=com\u liferay\u login\u web\u portlet\u LoginPortlet
来解决我的问题