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

auth.setPersistence() not supported (no way to offer 'keep me logged in' ?).

Open nisserne opened this issue 6 years ago • 7 comments

Via firebaseUI-angular I came across the undocumented ui.disableAutoSignIn(). However, how to use this one-way switch to offer a super-standard 'keep me signed in' option (security requirement) ?

I tried to use auth.setPersistence(), but this behaves weird in combination with firebaseUI (auto signs out first instance, when opening a second instance etc.).

nisserne avatar Mar 17 '20 11:03 nisserne

ui.disableAutoSignIn() is only for one-tap sign-in. It is not related to Firebase Auth sessions.

setPersistence basically decides whether the user should be persisted across windows and on browser restart (local), whether it will persist only on the current window and will be cleared on close (session) or whether no persistence is applied (none).

bojeil-google avatar Mar 17 '20 17:03 bojeil-google

bojeil-google, I don't know what one-tap sign-in is (?), but I will ignore the function then. What are you saying about setPersistence(), is this not the way to add a 'keep me signed in' option to firebaseUI?

nisserne avatar Mar 18 '20 13:03 nisserne

Please read the documentation. By default we keep the user signed in. So you probably don't need to do anything.

bojeil-google avatar Mar 18 '20 17:03 bojeil-google

Thank you bojeil-google. I have read the documentation, but the problem is exactly that the auth persistence is hard. I need a "DO NOT keep me signed in" mode. How should a user protect his data, if visiting his account on a public device, when auth persistence is implicit set to LOCAL? Shouldn't firebaseUI include a 'Keep me signed in' option, or support an outer wrapper for this?

I have tried to call auth.setPersistence(), but this seems to be incompatible with the Email/Link sign-in as this completes the sign-in in a second browser tab: https://stackoverflow.com/questions/60723668/has-firebaseui-no-keep-me-signed-in-option

nisserne avatar Mar 19 '20 14:03 nisserne

I have now figured out a working setup for managing authentication persistence outside of firebaseUI. https://stackoverflow.com/questions/60723668/has-firebaseui-no-keep-me-signed-in-option/60810290#60810290.

nisserne avatar Mar 23 '20 08:03 nisserne

Thank you for taking the time to submit this feature request.

We are happy to let you know that a resolution is already planned and on the roadmap for our upcoming new version.

We are actively working on the new SDK and will be sure to update this feature request once we have a public beta or a release candidate that includes this functionality. Please watch the main repository for the latest release.

In the meantime, we will keep this feature request open for tracking.

dackers86 avatar Nov 25 '25 16:11 dackers86

v7 beta has been released. We no longer support v6. Persistence should be enabled by default when passing in auth instance to FirebaseUI initializer. However, if you find a bug on v7, feel free to file a new issue.

russellwheatley avatar May 15 '26 07:05 russellwheatley