7

${_csrf.parameterName} and ${_csrf.token} coming empty in login form. I am using Spring 4.1.3 and Spring Security 3.2.5
All the configurations are made correctly but still i am getting

<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>

as

<input type="hidden" name="" value=""/>

1 Answer 1

2

I found the answer, i placed the security filter tags in web.xml at top of any other filters and it worked.

Sign up to request clarification or add additional context in comments.

4 Comments

i did the same, but still getting empty csrf
In spring security xml file, you need to have <intercept> tag for the respective uri, in which <csrf> tag must be there.
@Giridhar Please provide complete answer.
<http pattern="/some-uri-pattern/**" auto-config="true" use-expressions="true" create-session="stateless"> <csrf disabled="false" /> </http>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.