1
我正在構建一個可通過facebook/twitter登錄的移動web應用程序。我希望應用程序通過Spring安全性的記住我的功能來記住登錄,以便用戶需要頻繁登錄。設置彈簧安全性通過Facebook登錄後記住我的Cookie
我有部分將調用Facebook並獲取將標識用戶的access_token。我可以用
SecurityContextHolder.getContext().setAuthentication( new UsernamePasswordAuthenticationToken(principal, credentials, authorities));
我想使用類似的方法,通過
RememberMeAuthenticationToken auth = new RememberMeAuthenticationToken(key, principal, authorities); SecurityContextHolder.getContext().setAuthentication(auth);
添加記住我的功能,同時該登錄用戶登錄用戶,它不設置記得我的cookie。我在這裏錯過了什麼?
謝謝!
帶記住我參數的請求是否需要POST? – pkrish
另外,我是否需要編寫自己的記住我服務的實現? – pkrish