-1

I'm trying to find a way to read inbox email of a Google private Group using GmailAPI. I thought about using a service account that will be a member of this group with only read access. Do you know how can I do that?

Thanks,

Dan

1 Answers1

0

You need to set up domain wide delegation from a gsuite domain in order to use service accounts with gmail.

  • Open the Service accounts page. If prompted, select a project.
  • Click add Create Service Account, enter a name and description for the service account. You can use the default service account ID, or choose a different, unique one. When done click Create.
  • The Service account permissions (optional) section that follows is not required. - Click Continue. On the Grant users access to this service account screen, scroll down to the - Create key section. Click add Create key.
  • In the side panel that appears, select the format for your key: JSON is recommended.
  • Click Create. Your new public/private key pair is generated and downloaded to your machine; it serves as the only copy of this key. For information on how to store it securely, see Managing service account keys.
  • Click Close on the Private key saved to your computer dialog, then click Done to return to the table of your service accounts.

Perform Google Workspace Domain-Wide Delegation of Authority

Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449
  • But domain wide delegation will alow my service account to access all user data ? what if I want it to only access mails of only one Group ? – dan azoulay Jan 26 '21 at 15:00