Search code examples
google-apigoogle-oauthgoogle-plus

How to replace people.me from Google+ with Google People/Google Sign In api?


I had a "sign in with Google+" function in my web-app. Upon signing in I would show user's email and name on the page and save it to database. To fetch user's profile data after sign in I used Google+ API method people.me with access_token in GET params.

Google+ API is going to shut down on March 7. I have to migrate to Google People or some other api. How do I achieve the same goal with a different google API? I need to fetch email and name by known auth token.


Solution

  • We use this through Laravel's Socialite, and they're replacing it with:

    https://www.googleapis.com/userinfo/v2/me
    

    You may want the profile scope as part of the OAuth flow to make the profile data accessible through this methods. Otherwise it will return incomplete data.