Our system using Google Oauth to allow a user to sign up from Google account. However, for some of the users, we can only get email and avatar but not First Name and Last Name.
The setting in Oauth Google Console having following scopes added
- profile
- openid
- /auth/contacts.readonly
Using the following scope for requesting
- https://www.googleapis.com/auth/userinfo.email
- https://www.googleapis.com/auth/contacts.readonly
- https://www.googleapis.com/auth/plus.me
The result return from API is
{
"identifier": "1026834XXX",
"webSiteURL": "",
"profileURL": "",
"photoURL": "https:\/\/lh3.googleusercontent.com\/a-\/AAuE7mAZnGB1XXX",
"displayName": "",
"description": "",
"firstName": "",
"lastName": "",
"gender": "",
"language": "",
"age": "",
"birthDay": 0,
"birthMonth": 0,
"birthYear": 0,
"email": "[email protected]",
"emailVerified": "",
"phone": "",
"address": null,
"country": "",
"region": "",
"city": null,
"zip": ""
}
Isn't every gmail account should have firstName and lastName ?