[英]Spring-boot security remember-me token not working
出於某種原因,我無法讓Spring-Security與記住我一起工作。 它永遠不會在客戶端創建cookie。
這是我的登錄表單
<input type="checkbox" name="_spring_security_remember_me"/> Remember me
也試過了
<input type="checkbox" name="remember-me"/> Remember me
這是我的SecuritySettings
http.authorizeRequests()
......
.anyRequest().fullyAuthenticated()
.and()
.formLogin().loginPage("/login").failureUrl("/login?error").permitAll()
.and()
.logout().logoutRequestMatcher(new AntPathRequestMatcher("/logout")).logoutSuccessUrl("/login")
.and()
.rememberMe()
.tokenValiditySeconds(31536000);
我嘗試了我自己的自定義表單和內置的Spring登錄表單..沒有工作記住我。
我測試的方式是,登錄,復制安全網址,關閉瀏覽器,打開瀏覽器並粘貼網址。
這就像將fullyAuthenticated()更改為authenticated()一樣簡單。
正如在fullAuthenticated()的javadocs中所說:
指定經過身份驗證且未“記住”的用戶允許使用URL。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.