I'm trying to get the authenticated user's email addresses.
I've done the authentication with scopes
email
profile
https://www.googleapis.com/auth/plus.login
https://www.googleapis.com/plus/v1/people/me
https://www.googleapis.com/auth/userinfo.email
This call returns null for email but name, link, picture, etc are populated:
Userinfoplus userinfo2 = oauth2.userinfo().v2().me().get().execute();
log.info(userinfo2.toString());
outputs:
{
"family_name" : "Homlish",
"gender" : "male",
"given_name" : "Paul",
"id" : "107004799409225320539",
"link" : "https://plus.google.com/107004799409225320539",
"locale" : "en",
"name" : "Paul Homlish",
"picture" : "https://lh4.googleusercontent.com/-bCRlXUqr__E/AAAAAAAAAAI/AAAAAAAABR8/LQCliyz_jgI/photo.jpg"
}
inspecting I can see an email field, but it is null.
Any ideas what I am missing?
Although the scopes I am using don't prompt the user for extra permissions, are there any scopes I can delete as not needed?
Thanks, Paul