用于Firebase身份验证的Facebook Auth Emulator



我正在尝试构建一个使用React Native但使用Firebase工具的项目。我的项目是使用Expo Bare工作流构建的,并使用Inverse的React Native Firebase库与Firebase集成。

React Native Firebase v.10及以上版本现在支持在Firebase Auth上使用Emulator。然而,该模拟器不支持Facebook社交身份验证。有变通办法吗?

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

尝试使用Facebook登录时出错:

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

*注意:在我的UI上,我仍然可以重定向到Facebook,当我单击"继续"按钮时,会返回上面的错误。

面临相同的错误,其中:[Flutter(2.2.3(+Firebase Auth模拟器(9.16.0(]

不幸的是,在撰写本文时,这似乎是意料之中的行为。来自Firebase在线文档:

请注意,模拟器仅支持从Google Sign-In、Apple和其他使用JSON Web令牌(JWT(实现的ID令牌的提供商检索的凭据的signInWithCredential身份验证不支持访问令牌(例如Facebook或Twitter提供的令牌,它们不是JWT(下一节将讨论在这些情况下的替代方案。

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

我希望Firebase团队最终能在他们的Firebase Auth Emulator中添加对Facebook登录的支持。

最新更新