【问题标题】:Firebase Google OAuth redirect errorFirebase Google OAuth 重定向错误
【发布时间】:2017-01-05 21:10:06
【问题描述】:

我正在从 Firebase 2 和 AngularFire 1 迁移到 Firebase 3 和 AngularFire 2。使用 Firebase 2 和 AngularFire 1,我可以使用所有六个身份验证选项:Google、Facebook、Twitter、Github、电子邮件和密码,以及匿名.现在使用 Firebase 3 和 AngularFire 2,五个身份验证选项正在工作,但 Google OAuth 拒绝工作。我正在使用$scope.authObj.$signInWithPopup("google")。弹窗弹出,但随后出现错误消息:

The redirect URI in the request, https://crudiest-firebase.firebaseapp.com/__/auth/handler, does not match the ones authorized for the OAuth client.

在我的 Google Developers Console 中,我将授权重定向 URI 设置为 https://crudiest-firebase.firebaseapp.com/__/auth/handler。这是适用于 Facebook、Twitter 和 GitHub 的 URI,它与错误消息中的 URI 相同。

此错误消息已持续数天。

只是为了便于比较:

https://crudiest-firebase.firebaseapp.com/__/auth/handler // rejected redirect URI https://crudiest-firebase.firebaseapp.com/__/auth/handler // redirect URI in console

有什么建议为什么 Google 会给我这个错误消息?

【问题讨论】:

  • 有时,应用更改需要几分钟时间,请确保为您的 oauth 2.0 凭据添加授权的 Javascript 来源和授权的重定向 URI。确保两者都使用相同的项目。

标签: google-oauth angularfire firebase-authentication


【解决方案1】:

Google 的错误消息包含一个项目 ID。 Google Developers Console 为每个项目都有一个项目 ID。这两个项目 ID 不匹配。当您在 Google Developers Console 中创建项目时,您会获得一个“客户端 ID”和一个“客户端密码”。然后,您可以在 Firebase 控制台中输入或更改这些内容,方法是选择您的项目,然后在左侧栏中选择“Auth”,然后选择“SIGN-IN METHOD”选项卡,然后选择“Google”,然后单击箭头打开“ Web SDK 配置(可选)。”然后您就可以更改“Web 客户端 ID”和“Web 客户端密码”。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-12-10
    • 2015-08-09
    • 2014-03-06
    • 1970-01-01
    • 1970-01-01
    • 2015-05-24
    • 2018-01-18
    • 2019-05-06
    相关资源
    最近更新 更多