How do I introduce a Remember me checkbox into an existing project using Spring Security?
3 answers
So, this is a complete WAG - but how would I go about it, at least initially.
I would override the Spring SecurityContextPersistenceFilter so that it only stores the authentication data (i.e. SecurityContext
) if it is (you know this from some attribute you included when you submitted the login form). You can also create a new Cookie if the checkbox is checked and check for the mentioned Cookie before trying to authenticate - if the cookie exists, it contains UserDetails and will be authenticated, otherwise it is redirected to the login page.
0
a source to share