GMail API Super Admin access other users accounts via API?

ぐ巨炮叔叔 提交于 2019-12-01 06:24:13

You cannot authenticate as yourself and get access to other mailboxes, even if you are an admin in the domain. HOWEVER, as a domain admin, you can whitelist your app to access all users in the domain. It involves using a service account with domain wide delegation. You need to whitelist your app in the Google Apps Cpanel and use a slightly different auth flow. See: https://developers.google.com/identity/protocols/OAuth2ServiceAccount#delegatingauthority

Though really, email mistakes happen, just have them reply with a followup to correct the misinformation. Going and deleting the email from their mailbox, even if it's possible, seems like a really bad idea from a "user trust" perspective (what happens if you have a bug and delete the wrong mail!)--has someone tried reasoning with said person about this idea? :-D Users that have already seen the email may be worried/confused when it just disappears, etc.

In order to access other users account, each user will have to Authenticate and Authorize your application to access the particular scope.

Once done, you will get an authorization token , which you can use to get a refresh token.

You can then use these refresh tokens and access the accounts unless the users revoke access

However, you cannot avoid that one time activity of each user accepting to provide access to your application.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!