With Spring Security 3.2.0.RELEASE, how can I get the CSRF token in a page that is purely HTML with no tag libs

前端 未结 4 1907
不思量自难忘°
不思量自难忘° 2020-12-02 12:35

Today I upgraded from Spring Security 3.1.4 with the separate java config dependency, to the new 3.2.0 release which includes java config. CSRF is on by default and I know

4条回答
  •  盖世英雄少女心
    2020-12-02 13:20

    I use thymeleaf with Spring boot. I had the same problem. I diagnosed problem viewing source of returned html via browser. It should be look like this:

    
    
    
    Spring Security Example 
    
    
    
    />

    If you can't see this html code. You may be forgot to put th: tag before name and value.

    login.html

    
    
    
    Spring Security Example 
    
    
    
    Invalid username and password.
    You have been logged out.

提交回复
热议问题