How to set up csrf protection in jsf2.2 web application?

为君一笑 提交于 2020-01-25 10:14:33

问题


I have a jsf 2.2 web application without using the spring framework.

I searched on google and found out that jsf 2.2 provides out of the box csrf protection and you just have to enable it.

So I did that following this link. Jsf2.2 csrf demo

And added this in my faces.config.xml file

<protected-views>
    <url-pattern>/csrf_protected_page.xhtml</url-pattern>
</protected-views>

But how to set up url-pattern for all my .xhtml pages I have tried:

<url-pattern>/*</url-pattern>
<url-pattern>/*.xhtml</url-pattern>
<url-pattern>/faces/*.xhtml</url-pattern>

But none of these work.

来源:https://stackoverflow.com/questions/59728259/how-to-set-up-csrf-protection-in-jsf2-2-web-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!