简体   繁体   English

缝合 Facebook 身份验证返回“AuthError”

[英]Stitch Facebook authentication returns "AuthError"

Using the Stitch Facebook authentication provider with the Web/JS SDK the auth flow seems to work fine up until the redirect is done back to the Stitch servers.使用带有 Web/JS SDK 的 Stitch Facebook 身份验证提供程序,身份验证流程似乎可以正常工作,直到重定向完成后返回 Stitch 服务器。

loginFB() {
  const credentialFB = new FacebookRedirectCredential();
  this.$stitch.auth.loginWithRedirect(credentialFB);
} 

It then returns this error from the Stitch service:然后它从 Stitch 服务返回此错误:

https://eu-west-1.aws.stitch.mongodb.com/api/client/v2.0/auth/callback?code=AQClGc41QMShUyLT0FOIyGM4ZEi8FPEj4qSHF022F6gGqdIYrgBmop7QVWVuKQYH-CNCtGNSpOWJSVu9_nZwrHauMVrKt6CeswVIgRs5iQpt84YPFkg35BXZHf_PGcpvTsTBt2HC4B_yyYCcYCc4Ccn_wlCkG9bu-LwfKOePDtTYOJahys-xflBC8IyveMZIAK9lc00orXqC7zooETDgrE8KdoDw6uE8Q8zT_XMD7fGmCB7_-kcnmE9wScgC2Vsb38_AG4dkazNG_IenKpbo0s7vfDDfRLPawXpeWpSue_PRYLGSoKUB1UyWSNiujuq3ClE&state=nBspwBNKIdbEUxcyFdrHDudGKbuJhfjVTcHpzyMjSi-uImn5LQG3XtsgqRUGsB_UIEVnAIi6dswt5FwV90kphQ%3D%3D# = https://eu-west-1.aws.stitch.mongodb.com/api/client/v2.0/auth/callback?code=AQClGc41QMShUyLT0FOIyGM4ZEi8FPEj4qSHF022F6gGqdIYrgBmop7QVWVuKQYH-CNCtGNSpOWJSVu9_nZwrHauMVrKt6CeswVIgRs5iQpt84YPFkg35BXZHf_PGcpvTsTBt2HC4B_yyYCcYCc4Ccn_wlCkG9bu-LwfKOePDtTYOJahys-xflBC8IyveMZIAK9lc00orXqC7zooETDgrE8KdoDw6uE8Q8zT_XMD7fGmCB7_-kcnmE9wScgC2Vsb38_AG4dkazNG_IenKpbo0s7vfDDfRLPawXpeWpSue_PRYLGSoKUB1UyWSNiujuq3ClE&state=nBspwBNKIdbEUxcyFdrHDudGKbuJhfjVTcHpzyMjSi-uImn5LQG3XtsgqRUGsB_UIEVnAIi6dswt5FwV90kphQ%3D%3D# =

error: "error exchanging access code with OAuth2 provider"
error_code: "AuthError"
link: "https://stitch.mongodb.com/groups/5ded6422f2a30b6096c347b8/apps/5dfdd120fab085de276dacb2/logs?co_id=5e176295f9d51cd518d60dc6"

Following the link in the error message we arrive at the Stitch logs which says the same thing.按照错误消息中的链接,我们到达了 Stitch 日志,它说明了同样的事情。

在此处输入图片说明

I have followed the official docs (Google Auth works wonders, no worries there) for setting it up and tested the following:我已经按照官方文档(Google Auth 可以创造奇迹,不用担心)进行设置并测试了以下内容:

  • Modified Redirect URIs, tested on hosted (https / http) and localhost.修改后的重定向 URI,在托管 (https/http) 和 localhost 上测试。
  • Configured a Test App in Facebook dev在 Facebook 开发中配置了一个测试应用程序
  • Tested the various settings for the auth in Facebook console.在 Facebook 控制台中测试了身份验证的各种设置。
  • Enable forced Re-auth in Facebook, I must then provide password and once that completes same error.在 Facebook 中启用强制重新身份验证,然后我必须提供密码,一旦完成相同的错误。

Trying to find information on this error in the official docs or here on Stackoverflow has yielded no results unfortunately.不幸的是,试图在官方文档或 Stackoverflow 上查找有关此错误的信息没有结果。 Could someone help explain how to get around this error?有人可以帮助解释如何解决这个错误吗?

Docs: https://docs.mongodb.com/stitch/authentication/facebook/文档: https : //docs.mongodb.com/stitch/authentication/facebook/

https://docs.mongodb.com/stitch/tutorials/guides/todo-guide-facebook/ https://docs.mongodb.com/stitch/tutorials/guides/todo-guide-facebook/

The error shown was due to a faulty app secret in the Auth provider section in Stitch.显示的错误是由于 Stitch 中“身份验证提供程序”部分中的应用程序密码错误造成的。 Once that was mended to a correct secret from the Facebook App the login worked as intended.一旦从 Facebook 应用程序修复了正确的秘密,登录就会按预期工作。 This error should be mentioned somewhere in stitch docs but does not to be documented there at the time of writing this.这个错误应该在针脚文档的某个地方提到,但在写这篇文章时没有记录在那里。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 是否可以在 Stitch Custom Authentication/Stitch Auth 中使用 Firebase signInWithEmailAndPassword - Is it possible to use Firebase signInWithEmailAndPassword in Stitch Custom Authentication/ Stitch Auth 自定义身份验证如何在MongoDB Stitch中工作 - How Custom Authentication Works in MongoDB Stitch MongoDB Stitch中的身份验证服务Webhook(端点) - Authentication Service Webhook (endpoint) in MongoDB Stitch MongoDB Stitch SDK返回“聚合阶段“不支持$ lookup” - MongoDB Stitch SDK returns “aggregation stage ”$lookup“ is not supported” MongoDB Stitch 将数据返回为 $NumberDouble 而不是数字本身 - MongoDB Stitch returns data as $NumberDouble instead of the number itself MongoDB Stitch在Facebook登录尝试中断登录过程期间对重定向URI进行了双重编码? - MongoDB Stitch double encodes redirect URI during Facebook login attempt breaking the login process? Android 基于 MongoDB Stitch 的应用程序登录,具有 email 身份验证,在 Google Play 商店上发布应用程序后不起作用 - Android App login based on MongoDB Stitch, with email authentication, doesn't work after app publication on Google Play Store Facebook 身份验证使用护照失败 - Facebook Authentication fails using passport Angular 7应用程序中的MongoDB Stitch - MongoDB Stitch in Angular 7 application Mongodb Stitch 实时手表 - Mongodb Stitch realtime watch
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM