I am building Alexa Skill for Google calendar. The client side code works as expected on local machine because I can authenticate the local machine using the link. But, when I deploy the code on AWS Lambda there is no way that I can authenticate as I cannot input code via AWS console.
I am getting trouble in setting up authentication of Google Calendar API when deployed on AWS lambda.
This documentation doesn't help much to me Google Implementing Server Side Authentication
You should create a service account. Those are designed especially for server-to-server communication. Documentation can be found here: https://developers.google.com/identity/protocols/OAuth2ServiceAccount
The problems with the solutions from other answers are:
gcloud auth print-access-token
) expire. Since Lambdas are stateless, there's no way to store a token temporarily and refresh it when it's expired.