I have a pretty standard project with Spring Security.
I have a login form and I need to add 'Remember me' checkbox there. How can I do that?
I can provide some code if necessary.
I have a pretty standard project with Spring Security.
I have a login form and I need to add 'Remember me' checkbox there. How can I do that?
I can provide some code if necessary.
Roman,
Unfortunately I have no idea, and I would be interested, too.
I have been facing the similair problem, I have a checkbox on the login page, and I have some java beans in the applicationcontext.xml
my question is how can I make a connection between the two of them? What should I do in order to acheive that the remember-me function applies to one particular checkbox?
many thanks
ternero
So this is a complete WAG - but it's how I would do it, at least initially.
I would override the Spring SecurityContextPersistenceFilter so that it only saves the Authentication details (i.e. the SecurityContext
) if that box is checked (you would know this by some attribute you included when you POST the Form for login). You could also, possibly, create a new Cookie if the box is checked and check for the existence of said Cookie before you try Authentication - if the cookie exists it contains the UserDetails and will authenticate, otherwise redirect to the login page.
I think the below links will be very useful,