Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FirebaseUI returns 'Error: The current environment does not support the specified persistence type'. #270

Closed
nearAP opened this issue Dec 9, 2017 · 11 comments

Comments

@nearAP
Copy link

nearAP commented Dec 9, 2017

I followed the example described here to add login support to my application using firebase. Everything works if the application is accessed from a desktop browser. However when you use a mobile browser (safari on iPad or iPhone), you get the error message - Error: The current environment does not support the specified persistence type. Because of the error message, you don't get to see the Firebase UI i.e the option to choose whether to login via Google, Facebook, Twitter, etc.

Note:

  1. I'm using firebase 4.6.2
  2. I'm using the option to only include the features that I need and so I have -
    https://www.gstatic.com/firebasejs/4.6.2/firebase-app.js
    https://www.gstatic.com/firebasejs/4.6.2/firebase-auth.js
  3. I'm also using - https://www.gstatic.com/firebasejs/ui/2.4.1/firebase-ui-auth__en.js
@bojeil-google
Copy link
Contributor

You must be using Safari in private browsing mode. Sign in with OAuth popup/redirect does not work when 3rd party cookies are disabled in that mode.

@nearAP
Copy link
Author

nearAP commented Dec 11, 2017

@bojeil-google : This solved the problem. I have a few follow up questions though

  1. I have disabled 3rd party cookies in Chrome but I don't have this problem when in Chrome or Firefox desktop (private and non-private modes).
  2. I also don't have this problem in Safari desktop when I disable 3rd party cookies and I'm not in private mode. But when I'm in private mode on the desktop, I get the problem.

Please note that the issue here is - I don't get the UI with the different login options. I'm not talking about selecting one of the login options and not being able to login with it.

Based on all of the above, do you still think this is a 3rd party cookie issue? Is there a known workaround to this issue?

Thanks

@bojeil-google
Copy link
Contributor

bojeil-google commented Dec 11, 2017

I think private/incognito modes behave differently depending on browser and whether the device is mobile/desktop.
It is a known issue that signInWithPopup/signInWithRedirect will not work in Safari private mode browsing. There are no workarounds for it. I think you could use native SDKs (Google/Facebook JS SDKs) to get an OAuth credential and signInWithCredential but that is not supported in FirebaseUI at the moment.

@nearAP
Copy link
Author

nearAP commented Dec 12, 2017

@bojeil-google : Thanks

@TarikHuber
Copy link
Contributor

Any news on this? Having same issue on the Edge browser in InPrivate mode.

@fexybob
Copy link

fexybob commented Aug 28, 2020

I can reproduce this in Google Chrome Incognito since by default Incognito has 3rd Party Cookies disabled. Are there any updates for this issue?

@veeralpatel
Copy link

Apple seems to blocking third party cookies by default now: https://webkit.org/blog/10218/full-third-party-cookie-blocking-and-more/. It seems like a big deal.

@bojeil-google
Copy link
Contributor

Popup flow should work now even when 3P cookies are disabled. Redirect still doesn't. You can fallback to sign in with popup when you encounter these cases.

@veeralpatel
Copy link

@bojeil-google I'm using the "manual" SSO flow and signInWithCredential outlined here and it's still not working while incognito.

@bojeil-google
Copy link
Contributor

It is likely that GSI JS library doesn't work in that mode. As I mentioned, you can just fallback to signInWithPopup. It will work in that mode.

@veeralpatel
Copy link

Ok I will create an issue in that repo. We're using signInWithCredential because there's some validation checks we want to run on the email/name before creating user entries in Firebase (signInWithPopup always creates new user entries in Firebase and never throws a auth/user-not-found error).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants