简体   繁体   中英

Facebook Auth Emulator for Firebase Authentication

I am trying to build a project that uses React Native but with Firebase's tools. My project is built using the Expo Bare Workflow and uses Invertase's React-Native-Firebase libraries to integrate with Firebase.

React-Native-Firebase v.10 and up now has support for useEmulator on Firebase Auth. However, the emulator has no support for Facebook social auth. Is there a workaround?

auth().useEmulator("http://localhost:9099");

Error when trying to login with Facebook:

[Error: [auth/unknown] An internal error has occurred. [ The Auth Emulator does not support facebook.com sign-in with credentials. ]]

* Note: On my UI, I am still able to be redirected to Facebook, it's when I click continue button the error above is returned.

Facing the same error, with: [ Flutter (2.2.3) + Firebase Auth emulator (9.16.0) ]

Unfortunately, it seems like at the time of this writing, this is expected behaviour. From Firebase online doc:

Note that the emulator only supports signInWithCredential authentication for credentials retrieved from Google Sign-In, Apple, and other providers that use ID tokens implemented as JSON Web Tokens (JWTs). Access tokens (eg those provided by Facebook or Twitter, which are not JWTs) are not supported. The next section discusses an alternative in these cases.

(ref.: https://firebase.google.com/docs/emulator-suite/connect_auth#testing_idp_flows_with_manual_credential_retrieval )

I hope the Firebase team will eventually add support for Facebook Login into their Firebase Auth Emulator.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM