#Google Calendar API scope not respected

1 messages · Page 1 of 1 (latest)

viral basin
#

I have an issue with the google calendar integration and oauth consent, as it is a complicated topic, I might have misunderstood something, but here we go.
I use the integration to show upcoming activities on central screen in my home, based on this, I do not want the integration to allow for write activities (adding, changing or deleting events). However, this does not seem to be possible with the integration.

  1. I have changed the scope for the oauth in google api:

  2. I have deleted the old token issued and created a new token

  3. I have added the new token to HA Application Credentials

  4. I disabled the Google Calendar integration and enabled it again

  5. I have selected the new token for Google Calendar Integration and deleted the old one in HA

  6. I have revoked the app access for the integration in my personal google account

  7. I have re-authorized the app for my google account

Now, the following is happening:

  1. If I select read-only access in the "configure" menu of the Google Calendar integration, the authorization fails with the following: Failed to set up: Required scopes are not available, reauth required
  2. Clicking "reconfigure" and reauthorizing just gives the same error, the consent screen still list the following permissions requested: See, edit, share and permanently delete all the calendars that you can access using Google Calendar
  3. Changing back to read/write in the "configure" menu for the Google Calendar integration and reauthorizing fixes the error in HA
  4. I can now still view AND DELETE events in my calendars using the integration...even if the scope in Google API is set to read only

Is this the way it is supposed to work? My understanding of the scope granting in Google Calendar API and the consent screen is that this scope should override any client claims, even if I approve them in the personal authorization screen.

Why is there a read-only setting and how would you set this up to work as read-only in the Google Calendar integration?