signInSuccessWithAuthResult is not called when using the Twitter Auth provider with the firebase emulator
Describe your environment
- Operating System version: Mac OS Big sur 11.1 on M1
- Browser version: 88.0.4324.192
- Firebase UI version: 4.7.3
- Firebase SDK version: 8.2.9
Describe the problem
When using the firebase emulator to connect to Twitter, the signInSuccessWithAuthResult callback never gets called. I've tried this with other idp provider such as facebook or github and it works as expected.
Steps to reproduce:
- Start the firebase emulator
- Change firebase auth to use the emulator
- Sign in using twitter
- After signing in, the page doesn't do anything. No errors are displayed on the console.
The problem is only with Twitter. It works fine with facebook or github.
Hi, thanks for reaching out! This certainly appears to be a bug. I've filed a ticket internally to track this (b/181909102)
Ah yup came here to report the same thing. Wasn't sure if this was an issue with this package or the react wrapper but will keep my eyes here for a fix.
Just chiming in here to say it would be great to see this fixed. This is blocking us from using Auth emulator locally for testing, etc. Thanks!
Any updates on this? This is preventing me from writing my e2e tests and can't therefore launch. Appreciate it if you could prioritize this or provide some pointer so I can address this myself.
@djibomar I did some investigation on this on the client-side and it appeared to me that this is an issue in the emulators themselves and not in the library. The emulated auth server just isn't finishing the sign-in flow for Twitter like it is for the other simulated providers (I assume this is an OAuth1 vs 2 error).
So I'm afraid you're basically at the mercy of the Firebase team's schedule to dig into the emulator and figure out what's wrong. As far as I know the emulator code isn't open source so we can't do it ourselves. (cc @samhorlbeck if I'm wrong about the emulator code or for an update about prioritization of this bug.)
For myself, my project was early days so I wound up pulling out firebase and switching over to Prisma + next-auth. I felt more confident with a stack where I could fix bugs like this myself given how long I've been left on read regarding Google bugs in the past...
The Auth Emulator is open source and the code can be found at https://github.com/firebase/firebase-tools/tree/master/src/emulator/auth. I'll dig into it when I have the bandwidth, but all are welcome to contribute.
@zackdotcomputer I'd appreciate it if you can share your debugging process and how you've pinpointed the issue in the emulator, especially any insights on where exactly the emulator did not complete the flow.
@yuchenshi to be honest this was almost a month ago so it's a bit hazy for me now. I know I started from the point of "we know that Twitter works in production mode, and we know that other 3rd-party providers like Github work in emulated mode, so we're looking for something that specifically breaks when dealing with both Twitter and emulation." I dug downwards through the codepaths that are triggered by configuring emulation - in this case I got to this line in this repository. I searched in the repo for all uses of emulatorConfig or other flags that I could find that were mutated by moving into emulator mode and nothing appeared to be branched based upon what provider you were using...
And that's where my memory goes hazy - I'm not sure how I jumped from that point to "ok well that rules it down to something in the emulated service itself" so it's totally possible that today-Zack would disagree with past-Zack's conclusion and say "well actually it could be in the Firebase client SDK itself." Either way I both didn't realize that the next layers of code were open source so I could keep digging and also at that point I was far enough into the legacy code weeds with goog.provide and goog.require that I was having flashbacks to working in Soy and GWT back in the day so I abandoned the debug delve to return to the bright airy world of React and Typescript.
I am adding Twitter method to my app and this bug appears to be still there, right? At least, do you know if Twitter works in live environments?