HorseloverFat
HorseloverFat

Reputation: 3336

Does the Google Users API return the (Primary Email) address of the User?

Although I don't see this documented anywhere, I am assuming that the User object returned by the Google Users API has a 1-1 correspondence with a Google ACCOUNT, rather than an email address.

Assuming that to be true, and bearing in mind that Google Accounts can be associated with multiple email addresses, is it the PRIMARY EMAIL address of the Account that is returned by the email() method?

ie. the Primary Email as listed in https://www.google.com/settings/account for that user.

Upvotes: 0

Views: 138

Answers (2)

HorseloverFat
HorseloverFat

Reputation: 3336

The answer is yes - Google Users API returns the PRIMARY email address of the Google Account.

Upvotes: 0

dave_from_heuristics
dave_from_heuristics

Reputation: 123

The Google Account and the email address are one in the same in this case. This is demonstrated by the User class, which can only be constructed by an email address or a federated identity (depending on the identity set up of the app).

If the User constructor is called with an email address that does not correspond with a valid Google account, the object will be created but it will not correspond with a real Google account. https://developers.google.com/appengine/docs/python/users/userobjects?hl=en

Where you're thinking of multiple email addresses, I think that may be multiple Google accounts that can be linked. When using app engine's Google auth option the user is still prompted to pick a specific account to authenticate against (from a list of linked accounts if more than one).

Upvotes: 0

Related Questions