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
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…