Google API How to get email alias for user?

Question

Using Google OAuth for authentication, how can I get user email aliases?

I can not find any API docs on how to do this. What are the required areas and what is the right call to get this information?

Why

Let's say I have a user Alice who invites to bob@company.comuse the application. Unfortunately, bob@company.comit is actually an alias for bob.jones@company.com. When Bob enters the Google OAuth service, Google reports his email address bob.jones@company.com. Now I accidentally created two accounts for Bob when I want to recognize them as the same account.

+4
source share
1 answer

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

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

0
source

Source: https://habr.com/ru/post/1533598/


All Articles