Get all email addresses of user using Google API

前端 未结 4 1737
粉色の甜心
粉色の甜心 2021-02-15 12:20

For my own gmail account, I have multiple email addresses associated with it. For example, I have an email address from my university that is associated with my gmail, and I ca

4条回答
  •  难免孤独
    2021-02-15 12:43

    If you use OAuth to have your users sign-in with their Google accounts (with or without G+) the user will be prompted (by Google) to select which of their accounts they wish to authorize your application to use: https://developers.google.com/accounts/docs/OAuth2Login

    So to directly answer your question, I'm not aware of an API to return that list of users - however you shouldn't need to, Google will take care of this before returning to your application.

    If your user is already logged in, and you wish to give them the ability to change the Google account they are using, I believe it is possible to prompt them again to select the account they are interested in (search for select_account on the link above).

提交回复
热议问题