Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
880 views
in Technique[技术] by (71.8m points)

service accounts - Gmail API restrict access to only one Group

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

question from:https://stackoverflow.com/questions/65902371/gmail-api-restrict-access-to-only-one-group

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...