web-components icon indicating copy to clipboard operation
web-components copied to clipboard

[login] Add "remember me" checkbox

Open OlliTietavainenVaadin opened this issue 5 years ago • 9 comments

Missing feature: "Remember me" checkbox, which you could check if you want your login info to be stored so that you don't need to log in again with the same browser unless you log out or some amount of time passes.

OlliTietavainenVaadin avatar Mar 13 '19 09:03 OlliTietavainenVaadin

I agree with @OlliTietavainenVaadin

ugurdoksan avatar Mar 17 '20 14:03 ugurdoksan

Will this be implemented? We missing that feature

osenbg avatar Apr 18 '20 10:04 osenbg

I can't wait for an out of the box solution for a 'remember me' button. That is a must feature for modern apps.

Kleanthismits avatar May 03 '20 12:05 Kleanthismits

I agree that this would be a highly appreciated feature for Vaadin's login component.

jason-unsworth avatar Mar 03 '21 18:03 jason-unsworth

This feature is very much needed. What is a temporary workaround? Only the Mozilla browser remembers your username and password at the moment and autofill fields.

Suplab-commits avatar Apr 25 '21 23:04 Suplab-commits

@Suplab-commits If you use Spring Security you could enable it by default:

http.rememberMe().alwaysRemember(true)

timomeinen avatar Apr 26 '21 12:04 timomeinen

@timomeinen Hello. I've tried a million ways, including this one. But if the user is not active for some time, then the session ends anyway, although the validity of the token I set is one year. Why is this happening? All settings work in Security Configuration, except "remember Me". Here is my "Security Config" class. Please help me. SecurityConfiguration.zip

Suplab-commits avatar Apr 27 '21 17:04 Suplab-commits

@Suplab-commits This is no place for Spring Security support. Please have a look at the docs.

But from what I see in your example, remove the rememberMeServices bean. Your tokenRepository is sufficient. This should do it:

http.rememberMe()
            .alwaysRemember(true)
            .tokenRepository(tokenRepository())
            .and()

timomeinen avatar Apr 28 '21 10:04 timomeinen

I have created an example project here with a README: https://github.com/jcgueriaud1/remember-me

jcgueriaud1 avatar Aug 12 '22 13:08 jcgueriaud1