I have to implement signIn by google account.
I want to some suggestions.
I created project in google console. Added scope user info.profile
I'm following course instruction on internet, but I still cannot get userinfo ( email, name, age ... ).
Step:
- Get code in url redirect_uri by client_id
- Get token https://accounts.google.com/o/oauth2/token by code, client_id, client_secret ...
- Try call to https://www.googleapis.com/oauth2/v3/tokeninfo?access_token=accessToken to get info but only object
{
"azp": "155122683461-51hq2n932svo4ajbt98ic0q67m4tuj5o.apps.googleusercontent.com",
"aud": "155122683461-51hq2n932svo4ajbt98ic0q67m4tuj5o.apps.googleusercontent.com",
"sub": "108865940357700877124",
"scope": "https://www.googleapis.com/auth/userinfo.profile",
"exp": "1554094721",
"expires_in": "3326",
"access_type": "offline"
}
Can you guys give me an example :(
Thanks
GET https://www.googleapis.com/oauth2/v3/userinfo?access_token=accessToken
– TanaikeGET https://www.googleapis.com/oauth2/v3/userinfo?access_token=accessToken
But response not contain email ??? – Vũ Anh Dũng