Open jonathon-love opened 2 years ago
here's the problem occuring with the project's online demo:
in the firebaseui demo, onAuthEvent()
is never called. however, if you run the firebase quickstart microsoft demo, that same error is thrown, however the onAuthEvent()
is called. see here:
i'll add that the firebaseui-web sometimes does work ... often the first time i interact with it, it "just works", but in any sort of log back out, open a private window, try again, testing dev workflow ... it stops working. you see this in the js quickstart demo ... the first time i try it, it works, but the second time it fails. this error is more common in firefox too ... i still do get it to happen in chrome though.
Hi, thanks for filing this issue! We are unable to promise any timeline for this, but if others also have this issue, adding a +1 on this issue can help us prioritize adding this to the roadmap.
(Googler-only internal tracking bug: b/228618898)
+1
+1
hi,
i think it's important for the firebaseui project to be more upfront about this limitation ... that the microsoft login only works intermittently ... i think many people will see the promise of firebaseui -- a project that allows easy log in to all providers -- as compelling, invest the hours into incorporating it into their project, only to find that it doesn't live up to that promise.
the caveat that it doesn't really work with microsoft log in needs to be front and center in the documentation, along with communicating that addressing this short-coming isn't really a priority:
We are unable to promise any timeline for this
we would never have spent the time incorporating firebaseui had we understood this limitation.
FWIW I'm not able to reproduce in Chrome v100, MacOS. What flavor of microsoft accounts are you experiencing this with?
i just reproduced (first attempt) using one of those @outlook.com accounts ... i think it's more common in ff than chrome, but i've definitely seen it in chrome.
+1. This happens for me in Firefox - login with Facebook.
+1 in Firefox
+1 in chrome mobile version 101.0.4951
+1
+1
+1
+1
It would be great if this could be fixed or the limitation made clearer in the documentation
+1
+1
+1
+1
I had this problem on FireFox with the sign in with Google as well.
+1 in chrome mobile version 99.0.4844
+1 on Android 13, Chrome Mobile 106.0.5249.126
+1
+1
+1
+1
Running Chrome v107.0.5304.110 on LinuxMint 10.3
Happened once trying to login via Google Login, using custom firebase login (not firebaseui package). Works fine on Windows machine
Same problem on Chrome 108.0.0 Mac os 10.15.7
I have this problem with SignInWithPopup
(Firebase Web SDK v9). The popup pops and 3s later it closes with this error message:
Uncaught (in promise) FirebaseError: Firebase: Error (auth/popup-closed-by-user).
then about 8s later on this error message shows in the console:
@firebase/auth: Auth (9.15.0): INTERNAL ASSERTION FAILED: Pending promise was never set
What's weird is that the Sign in seems to work as I am able to catch the user information in the onAuthStateChanged
listener. But is not persisted between refreshes.
I have this problem with
SignInWithPopup
(Firebase Web SDK v9). The popup pops and 3s later it closes with this error message:Uncaught (in promise) FirebaseError: Firebase: Error (auth/popup-closed-by-user).
then about 8s later on this error message shows in the console:
@firebase/auth: Auth (9.15.0): INTERNAL ASSERTION FAILED: Pending promise was never set
What's weird is that the Sign in seems to work as I am able to catch the user information in the
onAuthStateChanged
listener. But is not persisted between refreshes.
I had a similar problem, and it was because I was using the ip 127.0.0.1 and it did not belong to an authorized domain. I changed to localhost and it worked again. You can go to the firebase configuration, and check the authorized domains. Hope this can help you
Any updates on this? seeing same error on Google login running on Firefox Really hoping I don't have spend time undoing all the Firebase integration...
My use started happening similar to Jonathon's where I cleared the cache data on signout.
i'll outline the steps we used to workaround the issue.
microsoft.com
in the providers passed to authUI.start()
microsoft.com
button and wire-up your own MS login process, i.e. uiShown(): void {
let emailProvider = document.querySelector('.firebaseui-id-idp-button[data-provider-id="password"]')?.parentElement;
// insert the microsoft button after the email button
emailProvider?.insertAdjacentHTML('afterend', '<li class="firebaseui-list-item"><button class="firebaseui-idp-button mdl-button mdl-js-button mdl-button--raised firebaseui-idp-generic firebaseui-id-idp-button" data-provider-id="microsoft.com" style="background-color:#2F2F2F" data-upgraded=",MaterialButton"><span class="firebaseui-idp-icon-wrapper"><img class="firebaseui-idp-icon" alt="" src="https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/microsoft.svg"></span><span class="firebaseui-idp-text firebaseui-idp-text-long">Sign in with Microsoft</span><span class="firebaseui-idp-text firebaseui-idp-text-short">Microsoft</span></button></li>');
// get the microsoft.com button
let msProvider = document.querySelector('.firebaseui-id-idp-button[data-provider-id="microsoft.com"]');
msProvider?.addEventListener('click', async (event) => {
// use the msal library to get a microsoft id token
msalInstance.setActiveAccount(null);
const login = await msalInstance.loginPopup({ scopes: [ 'email' ], redirectUri: window.location.origin });
// send it to an end point which takes the ms token, verifies it, then returns a firebase token
let response = await fetch(`/token?msIdToken=${ login.idToken }`);
let tokenData = await response.json();
// sign in with the firebase custom token
await auth.signInWithCustomToken(tokenData.token);
});
},
unfortunately, the /token
endpoint you have to implement on the server side ... booo.
it's a bit of a pain, but we've been using the solution for about 6 months now, and it works well. i don't know what everyone else is doing ...
seems weird that such a crucial piece of functionality is broken in firebaseui ...
Hi, thanks for filing this issue! We are unable to promise any timeline for this, but if others also have this issue, adding a +1 on this issue can help us prioritize adding this to the roadmap.
(Googler-only internal tracking bug: b/228618898)
+1
+1
+1
+1 This feature is really crucial for us...
+1 (mobile Safari)
+1
+1
+1
+1
+1
+1
+1
+1 (Mobile Safari 17.5)
I have a unique corner case, where this happens in latest version of Chrome. If I first login, but then go back to my signin page, then this can be recreated consistently. By monitoring the console logs, I observed that if as soon as a page loads, I sign in with a Google provider using signInWithPopup
then I get this " @firebase/auth: Auth (10.12.2): INTERNAL ASSERTION FAILED: Pending promise was never set"
Here's why it's happening for me. I invoke sign-out when the sign-in page first loads, but if the sign-out call has not completed, and the user signs in again before that, then the message above appears. You have to wait for the callback from sign-out to finish before signing in again. Unfortunately, the sign-out is taking as much as 30 seconds to complete. It's not an ideal UX. However, Once sign-out does complete, and then I sign-in again, then it works correctly.
[REQUIRED] Describe your environment
[REQUIRED] Describe the problem
when using the web demo (the demo from this repo), logging in using the microsoft login provider does not complete correctly. the
signInSuccessWithAuthResult()
callback is never called. instead an error is thrown: