firebase / firebaseui-web

FirebaseUI is an open-source JavaScript library for Web that provides simple, customizable UI bindings on top of Firebase SDKs to eliminate boilerplate code and promote best practices.
https://firebase.google.com/
Apache License 2.0
4.57k stars 1.05k forks source link

Facebook logins stopped working on Android devices #1068

Open jobinkurianm opened 8 months ago

jobinkurianm commented 8 months ago

Describe your environment

Issue noticed in mobile web : Android devices + chrome browser

Operating system: Android 12 Chrome version : 120.0.6099.230 Configuration used : 'signInFlow': 'popup', Tried different firebase-ui-auth versions 6.1.0, 6.0.0 with firebase JS SDK v9 & v10 compat, but no luck.

Describe the problem

In mobile devices Facebook login is not working , No error message/ warnings displayed. Created exactly same project & updated firebase configurations:- https://fir-ui-demo-84a6c.firebaseapp.com/

Steps to reproduce:

Create exactly same project - https://fir-ui-demo-84a6c.firebaseapp.com/ and try it on chrome browser in an android device ( 'signInFlow': 'popup') Click facebook login , after login from facebook it will just land on app-login page. without logging in.

Additional information

Working fine in desktop browsers and IOS Devices . Also noticed, if we changed 'signInFlow': 'redirect', it will work first time , (second time we need to clear the cookie to make it work)

jhuleatt commented 8 months ago

Hi @jobinkurianm, I'll update the Facebook setup for our live demo so I can see if I can reproduce this issue. In the meantime, I wonder if this might be an issue with the underlying Firebase JS SDK - see https://github.com/firebase/firebase-js-sdk/issues/7958 for more info.

jobinkurianm commented 8 months ago

@jhuleatt Yes, Looks like issue with firebase SDK itself . Tried direct implementation using 'signInWithPopup', but getting error 'Firebase: Error (auth/popup-closed-by-user)'

jhuleatt commented 8 months ago

Thanks for confirming. Along with the previous issue I mentioned (https://github.com/firebase/firebase-js-sdk/issues/7958), it's probably worth keeping an eye on this issue too: https://github.com/firebase/firebase-js-sdk/issues/7807.

cptnoblivious commented 7 months ago

Having this same issue on our production site. Worse, both signInWithPopup() and signInWithRedirect() are affected in both the 120.x and beta 123.x versions of Chrome, specifically on Android. Literally all other browsers on all other platforms work fine - including Chromium-based browsers on Android such as Adblock Browser.

gsfeng commented 4 months ago

Is there any solution to this?

Ishan5hrestha commented 4 months ago

did anybody solve this?

jacquesgiraudel commented 1 month ago

Same problem for me, works fine on Desktop and iOS device but not on Android: signInWithPopup returns auth/popup-closed-by-user, signinWithRedirect does not work (getRedirectResult(getAuth()) returns null after redirect).

CT-HTrieu commented 1 month ago

Same problem for me, works fine on Desktop device but not on Browser mobile android and ios: signInWithPopup returns auth/popup-closed-by-user, signinWithRedirect does not work (getRedirectResult(getAuth()) returns null after redirect).

CT-HTrieu commented 1 month ago

Same problem for me, works fine on Desktop and iOS device but not on Android: signInWithPopup returns auth/popup-closed-by-user, signinWithRedirect does not work (getRedirectResult(getAuth()) returns null after redirect).

do you have any solution??

NhienLam commented 1 week ago

Hi everyone,

  1. Does this issue also occur in other browsers?
  2. Could you check if your authDomain matches the domain you're using? If not, please try updating your authDomain to match the domain you're using and see if the flow works.

For example, if your web domain is "example.com", your authDomain should also be "example.com"

Also ensure that you've add your domain to the list of authorized domains in the Firebase console (Authentication -> Settings).

We're investigating why this is occurring only on Android devices and Facebook provider. Thank you for your patience.

dmitry-yudakov commented 5 days ago

We ended up implementing Facebook native login for the web combined with Firebase manual sigh-in flow (signInWithCredential created with accessToken from fb SDK).

It took some time for Facebook to convince us the login was indeed broken - it worked perfectly fine on desktop, just not on mobile - but somehow they don't provide details like this in the violation reports.

jacquesgiraudel commented 5 days ago

Thank you for the advice, I note the solution