Fine-grained Google OAuth scope

Being a private paranoid, this is something I can't find using the Google OAuth2 doc - Can I ask for an email address and user ID ?

I remember that there is a time when I can get both the email address and the user id just by using

https://www.googleapis.com/auth/userinfo.email

      

Now it seems that without userinfo.profile

, google only returns the user's email address. I don't need anything other than the user ID from the profile area, though ... For me, it's a waste and asking for profile permission (birthday / location access) can cause unnecessary privacy issues (well, anyway.)

https://www.googleapis.com/auth/userinfo.profile

      

Is google user id required = get userinfo.profile

permission?

+3


source to share


2 answers


Actually you can only ask for user_ID

The currently supported method for adding the scope is https // www.googleapis. com / auto / plus.me



In the future, we will also support "openid" for this purpose, but this will also force the server to return OpenIDConnect compliant responses, and since this standard is still incomplete using it, you can now opt out of the incompatible API changes. >

+3


source


Yes, you will need a realm userinfo.profile

to get something more than an email address, confirmation that the address is verified, and hd on Google Apps user accounts (the hd attribute will let you know it as a Google Apps account, not a consumer). These 3 attributes are all that are returned userinfo.email

.



+1


source







All Articles