Gabriele Alfredo Pini
Gabriele Alfredo Pini

Reputation: 101

Google Calendar Push Notifications to Firebase Function

I'm a little stuck here.

I'm trying to hook a Calendar Push Notifications (https://developers.google.com/calendar/v3/push) to a Firebase HTTPS Function. Pratically, I use a FF to create a calendar and I want to watch it for changes.

I authorized my domain and compose a request from the first function using the appspot service account ('@appspot.gserviceaccount.com') with the scope 'https://www.googleapis.com/auth/calendar' but I always received the error message: "Unauthorized WebHook callback channel: https://******.cloudfunctions.net/calendarWebHook"}],"

I'm trying to understand if the service account doesn't have the authorization to create the watcher or the webHook or something else.

Upvotes: 4

Views: 377

Answers (1)

Martin Zeitler
Martin Zeitler

Reputation: 76809

That App Engine service account is probably not the correct one.

Authentication with a Service Account Key is the least effort to configure.

It's just important that the Cloud Function responds properly to the HTTPS request: https://developers.google.com/calendar/api/guides/push#respond-to-notifications

While setting this up, one can see what's going on in the Logs Explorer: https://cloud.google.com/monitoring/support/notification-options#view-log-messages


Think I've found a relevant hint (source) concerning the authentication:

Starting in this week's release, the serviceAccount that the function is configured to run as is the service account the associated service is configured to authorize its requests to the function with.

That comment was a few month ago; unsure if meanwhile there's also a triggerServiceAccount.
And from the time the question was asked and the bounty set, not sure if it's still the same issue.

Upvotes: 0

Related Questions