Reputation: 83
I have an issue with Google OAuth2 in my web application. I created client_id in the Google console and set scope to "openid email profile" in the url:
After successful login Google redirects me to my URL with id_token. But when I validate this token on the backend the token is valid but in the response the "name" field is missing.
Upvotes: 2
Views: 1641
Reputation: 116968
Google doesn't always return the claims you would expect. With open id connect. Also there is no guarantee that a user has even added a name.
If you are trying to get a users profile information you should use People.get. This is the best and most reliable way to get user profile information.
Don't rely on the claims.
Upvotes: 1