1

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 Answers 5

3

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
Sign up to request clarification or add additional context in comments.

2 Comments

after you've authenticated, yes, you can make a separate request to /plus/v1/people/{userid}
Generally, it helps to call people.get in the sign-in callback function in the JavaScript.
2

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'

Comments

2

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.

Comments

1

Works on me this way

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

between userinfo.profile and email has space in it

1 Comment

Works like a dream. Thanks! Its fascinating that Google would have 1000 pages of documents, but fail to mention such key information.
0

I have achieved multi-scoping using following scope param.

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.