4

Question

Using Google Apps OAuth for authentication, how can I retrieve a user's email aliases?

I can't seem to find any API docs on how to do this. What are the necessary scopes and what is the correct call to get that info?

Why

Let's say I have a user Alice that invites bob@company.com to use the app. Unfortunately, bob@company.com is actually an alias for bob.jones@company.com. When Bob logs into the service with Google OAuth, Google tells me his email address is bob.jones@company.com. Now I have accidentally created two accounts for Bob when I want to recognize them as the same account.

Andrew Hubbs
  • 9,338
  • 9
  • 48
  • 71

1 Answers1

-1

You can use the Google People API for this. Here's the documentation. The scope you need to use is: https://www.googleapis.com/auth/user.addresses.read

This will return all the email addresses for the user and also tell you which is the primary one.

  • 1
    NOTE: The correct scope for reading access to the authenticated user's email addresses is: `https://www.googleapis.com/auth/user.emails.read` – Americo Savinon Oct 20 '21 at 13:50