GMail API Super Admin access other users accounts via API?

前端 未结 2 665
春和景丽
春和景丽 2021-01-13 15:29

My institution is currently running Google Apps for Education since early 2009. I’m responsible for creating, deleting, modifying, etc. , student email accounts. I’ve conv

相关标签:
2条回答
  • 2021-01-13 15:52

    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.

    0 讨论(0)
  • 2021-01-13 16:03

    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.

    0 讨论(0)
提交回复
热议问题