I'm adding csrf security to a Spring-MVC project I'm working on. I'm using Spring security 5.2.15 and am following this answer here to disable csrf for a particular URL.
how do I Add this to as an argument into my csrfMatcher bean in my XML config file?
CodePudding user response:
I solved this by applying the bean tag and utilizing the class the static object uses with $ to reference it.
<b:bean id="csrfMatcher" >
<b:constructor-arg name="requestMatchers">
<b:list>
<b:bean />
<b:bean >
<b:constructor-arg>
<b:bean
c:pattern="login.html"/>
</b:constructor-arg>
</b:bean>
</b:list>
</b:constructor-arg>
</b:bean>