Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google API Explorer and Google Identity Toolkit API not working

I'm trying to explore the Google Identity Toolkit API using the Google API Explorer. The API hints that "No auth required", however when I try to execute a request there is an error message:

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

If I try to use the OAuth 2.0 toggle and Authorise the API I get a 400 error:

Error: invalid_request

Missing required parameter: scope

But Google Identity Toolkit API does not declare any scopes.

Please can someone help?

UPDATE: Further errors I get when using the API Explorer: When trying to execute the getAccountInfo request, I pass a request body with the localId field populated. The response I get is:

400 OK

- Show headers -

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "invalid",
    "message": "INVALID_SERVICE_ACCOUNT"
   }
  ],
  "code": 400,
  "message": "INVALID_SERVICE_ACCOUNT"
 }
}
like image 248
Dewiniaeth Avatar asked Apr 17 '26 15:04

Dewiniaeth


1 Answers

Here is the list of Google API scopes:

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

This completely omits Identity Kit.

Tying in a random string into the scopes box produces an error:

enter image description here

I have guessed up that the scope should be https://www.googleapis.com/auth/identitytoolkit by looking at the pattern.

And this scope does not cause an error. So this means it is a valid scope, even though it is undocumented.

That said, I used an API request of:

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

{ "maxResults": 999 }

And it produced:

200 OK

{ "kind": "identitytoolkit#DownloadAccountResponse" }

So I will say that I have successfully executed this query while using an undocumented feature. However, it appears that the result from the server is incorrect.

This should answer your question, although the result is simply shining light on a broken server implementation.

I have not reported the bugs / undocumented feature in this answer and would appreciate assistance in that effort.

like image 193
William Entriken Avatar answered Apr 22 '26 03:04

William Entriken



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!