Then record your "Client ID" and service account email address, forward it to G Suite administrator forĮnable Gmail API in "Library" -> Search "Gmail", then click "Gmail API" and enable it. Service accounts list, click "View Client ID" like this: To access user data in G Suite, you must get authorization from G Suite administrator. You can use created private key in your codes to request "access token" impersonating a user in G Suite. Now you have created service account with key pair successfully. Then you will get a file which contains private key, save the file to local disk. Go back to your service account again, click "Create Key", you can select "p12" or "json" key type, both can work well, Go back to your service account, click "Edit" -> "SHOW DOMAIN-WIDE DELEGATION", check "Enable G Suiteĭomain-wide Delegation", input a name for product oauth consent, click "Save". In "Grant users access to this service account", keep everything default and click "DONE"Īfter service account is created, you should enable "Domain-wide delegation" and create service key pair toĮnable "Domain-wide delegation" and create service key In "Service account permissions", select "Project" -> "Owner" as role Input a name for your service account, click "CREATE" Important Notice: You can use any google user to create service account, it doesn't require service accountīut G Suite administrator must authorize service account in G Suite AdminĪfter you created the project, select it from projects list as current project.Ĭreate service account under current projectĬlick "Credentials" -> "Manage service accounts" To use "G Suite Service Account OAUTH" in your application, you should create a project in Service account only works for G Suite user, it doesn't work for personal Gmail account.Ĭreate your project in Google Developers Console In this case, you should use google service account to access G Suite email service without user interaction. Normal OAUTH requires user input user/password for authentication. You can click here to learn more detail about "OAUTH/XOAUTH2 with Gmail SMTP Using OAUTH protocol, user can do authentication by Gmail Web OAuth instead of inputting user and The Gmail/GSuite IMAP and SMTP servers have been extended to support authorization via the industry-standard
![mac mail server using google apps accounts mac mail server using google apps accounts](https://www.combell.com/en/help/wp-content/uploads/2019/08/Screenshot-2019-12-11-at-15.59.38.png)
![mac mail server using google apps accounts mac mail server using google apps accounts](https://namecheap.simplekb.com/SiteContents/2-7C22D5236A4543EB827F3BD8936E153E/media/el_cap_cp_imap_2.png)
Using Gmail/GSuite SMTP OAUTH with Service Account Send Email using Gmail/G Suite OAUTH/XOAUTH2 with Google Service Account in C#, VB.NET, ASP.NET, C++/CLI.