Custom RememberMeServices
Up to this point, we have used a fairly simple implementation of PersistentTokenRepository. We have used a JDBC-backed and JPA-backed implementation. This provided limited control over the cookie persistence; if we want more control, we wrap our PersistentTokenRepository interface in RememberMeServices. Barry Jaspan has a great article on Improved Persistent Login Cookie Best Practice (http://jaspan.com/improved_persistent_login_cookie_best_practice). Spring Security has a slightly modified version, as previously described, called PersistentTokenBasedRememberMeServices, which we can wrap our custom PersistentTokenRepository interface in and use in our remember-me service.
In the following section, we are going to ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access