GOOGLE登录IONIC APP

时间:2017-08-25 10:07:09

标签: angularjs ionic-framework

使用离线应用中的谷歌登录获取错误

scopes were invalid. {valid=[https://www.googleapis.com/auth/fitness.activity.read, https://www.googleapis.com/auth/analytics.readonly], invalid=[https://developers.google.com/+/web/api/rest/oauth#email-scopes]}

请求详细信息

client_id=707870734492-q5dn4sc8vqf8o2231i1pm88ftrfi5jbd.apps.googleusercontent.com
scope=https://www.googleapis.com/auth/fitness.activity.read https://www.googleapis.com/auth/analytics.readonly https://developers.google.com/+/web/api/rest/oauth#email-scopes
immediate=false
hd=https://www.googleapis.com/discovery/v1/apis/reseller/v1/rest
include_granted_scopes=true
proxy=oauth2relay344347262
redirect_uri=postmessage
origin=http://localhost:8100
response_type=token
gsiwebsdk=1
state=252262168|0.4044143628
jsh=m;/_/scs/apps-static/_/js/k=oz.gapi.en.SzB8Yr0eZhM.O/m=__features__/am=AQ/rt=j/d=1/rs=AGLTcCOTlQsaBke91_BUwWpWd1UeaxtVCA`

我们如何解决此类错误,

1 个答案:

答案 0 :(得分:1)

简答:

https://developers.google.com/+/web/api/rest/oauth#email-scopes更改为email

答案很长:

在错误中寻找答案:

  

范围无效。

     

{有效= [https://www.googleapis.com/auth/fitness.activity.readhttps://www.googleapis.com/auth/analytics.readonly]

     

无效= [https://developers.google.com/+/web/api/rest/oauth#email-scopes]}

而是为email提供范围网址,您向所有auth电子邮件范围添加了网址,例如:https://developers.google.com/+/web/api/rest/oauth#email-scopes

这是all known scopes的列表。来吧,正确定义你的。

我会考虑:

scope: [
       'https://www.googleapis.com/auth/fitness.activity.read', 
       'https://www.googleapis.com/auth/analytics.readonly',                
       'email'
        ],

作为cordova google login plugin

的旁注