How do I get user profile using Google Access Token

I had the same issue. I wanted to extract the user information. But couldn’t get the exact link to hit. Then I went through the code for Passport Google Strategy at Line number 54.

My scopes were ['profile', 'email']

GET Request

https://www.googleapis.com/oauth2/v3/userinfo?access_token={access_token}

Response

{
  "sub": "23423....",
  "name": "John Doe",
  "given_name": "John",
  "family_name": "Doe",
  "picture": "<Profile picture URL>",
  "email": "[email protected]",
  "email_verified": true,
  "locale": "en"
}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)