1
votes

The google documentation HERE clearly says that

You should not request userinfo.profile or plus.me in combination with [https://www.googleapis.com/auth/plus.login] scope as they are implicitly included and would create a confusing permissions dialog for your user.

... yet if I don't use

https://www.googleapis.com/auth/userinfo.email and https://www.googleapis.com/auth/userinfo.profile along with https://www.googleapis.com/auth/plus.login the api will not return the user's email address or name.

If I'm not supposed to userinfo scope along with the plus.login scope how do I get the the user's name and email?

5

5 Answers

3
votes

You need userinfo.email to get the email address, but you should be able to request that without also requesting userinfo.profile. plus.login should give you access to the "GET /plus/v1/people/{userid}" call which should return the following fields/objects (at a minimum):

  • name - an object containing the name broken down into fields
  • displayName
  • nickname
2
votes

I also got into difficulty getting the profile and e-mail address. Finally I found that I can use these scopes to get everything:

'https://www.googleapis.com/auth/plus.login', 'email', 'profile'

2
votes

Seems like Google is a little vague in its documentation. They say the scope 'plus.login' contains the displayName and email, however, after running several tests with different Google accounts (plain Gmail, Google+, Google Apps) this seems to be false.

If the user doesn't have a Google+ profile, 'plus.login' will NOT contain displayName. This also seems to happen to Google Apps accounts. So, to cover all possible Google Account status, the safe bet is to request for:

They say the last 2 are deprecated, however, some accounts will not return all basic information if you don't use them. I don't know if this is related to the "age" of the Google account or just a bug on Google's end.

0
votes

I have achieved multi-scoping using following scope param.

scope = https://www.googleapis.com/auth/userinfo.email+profile

0
votes

Works on me this way

scope = https://www.googleapis.com/auth/userinfo.profile email

between userinfo.profile and email has space in it