Spring security 3.2 and CSRF injection in index.html file

Viewed 695

I am working on a web application using AJAX requests and static HTML/JS files. In order to prevent CSRF attack, I am thinking about adding CSRF token in index.html like this

<meta name="_csrf" content="${_csrf.token}"/>

However, since it is a static HTML file, I don't think Spring will inject the variable like it does for a JSP file.

Any ideas how could I instruct Spring to look at index.html and replace '${_csrf.token}' var with actual token value?

0 Answers
Related