I would like to rig things so that my GCP service account can invite users to calendar events. So for example my-service-account@myproject.iam.gserviceaccount.com
You need to enable the APIs and provide scopes in three places: in your auth code, in the GCP console, and the Google Admin console.
As I explained in the comments, the code you have provided should run without issue. The Insufficient Permission: Request had insufficient authentication scopes.
error is a result of the service account not being given access to the required scopes somewhere on Google's side.
Make sure you have completed the following steps:
const auth = new GoogleAuth({
scopes: ['https://www.googleapis.com/auth/calendar',
'https://www.googleapis.com/auth/compute']
});
Security > Advanced Settings > Manage API client access
UI elements, and assigning all scopes the service account needs to the service account client ID.Note: This final step must be done by a domain admin and can not be done by anyone who is not.
In this case, you will need to contact your domain admin to give your project API access.
I hope this is helpful to you!