1
votes

I'm configuring the scopes that my application requires for accessing Google and I can't find the difference between those two:

  1. https://www.googleapis.com/auth/userinfo.email
  2. https://www.googleapis.com/auth/userinfo.profile

In the documentation we can see the following:

https://www.googleapis.com/auth/userinfo.email View your email address https://www.googleapis.com/auth/userinfo.profile View your basic profile info

However, when I access userinfo via api-client-library I get all the info even in case I don't request one of the scopes.

com.google.api.services.oauth2.Oauth2#userinfo

Returns complete object. Event if I don't use email scope, email is still returned. But, if I don't use both of the scopes - access is restricted and call fails. The question is what's the difference between these two scopes and which one is preferable?

1

1 Answers

0
votes

https://developers.google.com/identity/protocols/oauth2/scopes#google-sign-in

Google Sign-In Scopes

profile: View your basic profile info.

email: View your email address.

openid: Authenticate using OpenID Connect.

Basic Profile: ID, Full name, Given Name, Family Name, Image URL.