Google API Explorer和Google Identity Toolkit API无效

时间:2015-08-06 14:22:36

标签: google-api google-identity-toolkit google-identity

我尝试使用Google API Explorer探索Google Identity Toolkit API。 API提示" No auth required"但是当我尝试执行请求时会出现错误消息:

This method requires you to be authenticated. You may need to activate the toggle above to authorize your request using OAuth 2.0.

如果我尝试使用OAuth 2.0切换和授权API,我会收到400错误:

Error: invalid_request

Missing required parameter: scope

但Google Identity Toolkit API不会声明任何范围。

请有人帮忙吗?

更新 使用API​​ Explorer时出现的其他错误:尝试执行getAccountInfo请求时,我传递了一个填充了localId字段的请求正文。我得到的回应是:

400 OK

- Show headers -

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "invalid",
    "message": "INVALID_SERVICE_ACCOUNT"
   }
  ],
  "code": 400,
  "message": "INVALID_SERVICE_ACCOUNT"
 }
}

2 个答案:

答案 0 :(得分:1)

以下是Google API范围列表:

https://developers.google.com/identity/protocols/googlescopes#oauth2v2

这完全省略了Identity Kit。

将随机字符串绑定到范围框中会产生错误:

enter image description here

我已经猜到,通过查看模式,范围应该是https://www.googleapis.com/auth/identitytoolkit

此范围不会导致错误。所以这意味着它是一个有效的范围,即使它没有记录。

也就是说,我使用了以下API请求:

  

POST https://www.googleapis.com/identitytoolkit/v3/relyingparty/downloadAccount?fields=kind%2CnextPageToken%2Cusers&key= {YOUR_API_KEY}

     

{    “maxResults”:999   }

它产生了:

  

200 OK

     

{   “kind”:“identitytoolkit#DownloadAccountResponse”   }

所以我会说我在使用未记录的功能时已经成功执行了此查询。但是,似乎服务器的结果不正确。

这应该回答你的问题,虽然结果只是在破坏的服务器实现上发光。

我没有在这个答案中报告错误/未记录的功能,并希望得到帮助。

答案 1 :(得分:-1)

您可以在官方网站上找到如何使用Google Identity Toolkit。如果你真的想尝试手动谷歌标识工具包API,您需要启用API在你的谷歌开发者控制台项目,在项目中创建一个ApiKey,并使用像袅袅的命令工具调用API。请求语法应遵循Google API Explorer中显示的语法。