3

For the past couple months I have been using this url to retrieve a user's name and info after logging in with OAuth.

    https://www.googleapis.com/oauth2/v1/userinfo?alt=json

This gave me JSON in the following format:

    {
      "id": "12345",
      "email": "[email protected]",
      "verified_email": true,
      "name": "First Last",
      "given_name": "First",
      "family_name": "Last",
      "link": "https://plus.google.com/12345",
      "picture": "https://lh3.googleusercontent.com/123photo.jpg",
      "locale": "en"
    }

This morning, when my app hit this endpoint, it got JSON in the following format:

    {
      "id": "12345",
      "email": "[email protected]",
      "verified_email": true,
      "picture": "https://lh3.googleusercontent.com/123/photo.jpg"
    }

I have not made any changes to the configuration in the developer console. Does anyone know what the cause of this problem could be?

4
  • Bschweer, have you checked my answer? Did it help or did you solve the problem in some other way? Commented Jun 4, 2019 at 6:21
  • Ján, I was able to solve this by updating the scope. My previous settings were working fine until the beginning of April. I do think the shutdown of Google+ had something to do with my issue. Commented Jun 5, 2019 at 17:03
  • How to update scope? Commented Mar 22, 2022 at 21:40
  • Even today I faced the same issue, untill tomorrow, it was returning bunch of data but now it only returns 4 attributes Commented Jun 25, 2024 at 16:27

1 Answer 1

1

I think you should use a different URL - the one from OpenID Connect, which is an OAuth2 extension for authentication and the userinfo endpoint is specified in its RFC.

https://openidconnect.googleapis.com/v1/userinfo

The correct procedure is to get this URL from the OpenID Discovery document (Google doc)

https://accounts.google.com/.well-known/openid-configuration

and its userinfo_endpoint attribute.

The change of behavior of the endpoint you have been using may have something to do with Google+ being shut down. But that's just my guess.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.