Google Calendar Service Account Authentication

  • Goal: Create calendar events for an employee within a google workspace using a service account.

  • Details:
    Google Calendar's api does not allow you to create events for a user via a service account. It requires you to add a claim to the JWT that appears as follows:
    "sub: impersonated-user@gmail.com"

From what I can find it does not look like there is a way to include an extra claim within the request to the Calendar API which makes this impossible. Is there any way to add an extra field within the service account authentication that allows for impersonation?

Thank you in advance.

Hello @Will_Goniprow,

Good question, I haven't heard of users adding additional fields to a JWT but I can check internally and see if this is possible.

I was looking at our docs and found this regarding resource authentication using a Google service account. Maybe in this object is where "sub: impersonated-user@gmail.com" could be added :thinking:

Hey Jack,

Thank you, that would be great if you did. If it's not possible, I'd like to make a feature request since that would be very useful when trying to make workflows or apps that use google calendar.

The credentials that are in the link are the service account credentials. Based on google's docs I don't believe I can insert the field there unfortunately. Also, I was hoping to change which user I'm impersonating each call which would require it not to be in the credentials field and a parameter on the request.

Best,
Will

Yes can do, I will file that feature request and keep you updated on any news i hear from our eng team!