2016-08-29 51 views
0

我正在从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")。弹出弹出,但随后有一个错误信息:Firebase Google OAuth重定向错误

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

在我的谷歌开发者控制台我已授权的重定向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

任何建议,为什么谷歌是给我这个问题?

+1

有时,需要几分钟才能应用更改,请确保为您的oauth 2.0凭证添加了授权的Javascript起源和授权重定向URI。确保你使用的是同一个项目。 – bojeil

回答

0

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