- Possible CSRF detected - state parameter was required but no state could be found
這個錯誤只在使用AuthorizationCode方式時出現, 就是客戶端反復刷新帶有code和state的參數的url導致的,因為code已經被使用過一次了,相當于過期了,你反復使用,自然會被認為是非法操作,所以"可能是CSRF攻擊",沒有說的那個是可能是你懵逼了
-
User must be authenticated with Spring Security before authorization can be completed.
必須配置 WebSecurityConfigurerAdapter
http.authorizeRequests().anyRequest().fullyAuthenticated();
http.formLogin().loginPage("/login").failureUrl("/login?error").permitAll();
http.logout().permitAll();
-
WebSecurityConfigurerAdapter 的配置類 NotSerialization 之類的錯誤
這個錯誤出現的可能非常低,但是如果真的出現了,八成是因為你在該類里寫了
http.userDetailsService(xxx);
刪掉就好了