3

I have various backend services running in containers. I am writing a microservice to handle the sending of emails.

My email provider for business emails is GSuite (Gmail).

I've been reading the following tutorial

This all seems well and good but it requires human intervention in order to authorise the application to send emails.

I need this to be fully autonomous in that whenever the container starts up it requests access tokens and authorises itself.

Is this possible? I can't seem to find any literature to help

mwild
  • 1,483
  • 7
  • 21
  • 41

1 Answers1

2

So I found a solution to this and thought I would post it just incase anyone else stumbles across this problem.

The answer to accessing the GMAIL API with no human intervention is service accounts.

Service accounts can impersonate authenticated users. So for instance I now have a service account sending emails as if they are coming from michael@mydomainname.com

I basically followed this

There are a few other steps to setting up service accounts that can be found here

I hope this helps someone.

mwild
  • 1,483
  • 7
  • 21
  • 41