Google Calendar setup - 500 error during Google device auth

Hi all.

I’m trying to set up Google Calendar in HASS. I’ve followed all the API setup steps:

  • I have a GCloud project
  • The Calendar API is enabled
  • I have OAuth consent screen configured
    • Audience is set to external
    • Consent screen is published (not in testing)
  • OAuth client created
    • Application type is web
    • Authorised redirect URI set to https://my.home-assistant.io/redirect/oauth

I then follow the setup process in Home Assistant’s integrations page and enter the OAuth client credentials from the client I created, after which it goes to device auth and opens a new tab to authenticate with Google.

I select the account, then I get this screen:

Once I select “Go to home-assistant.io”, nothing happens. After 3 seconds, it shows a little “Something went wrong” banner at the bottom.

In the browser network console, I can see that this 3 second delay is 3 retries to https://accounts.google.com/_/signin/oauth/danger/continue, all of which come back with a 500 error.

As a bit of context, I had this working before just fine. I even had the Google OAuth consent screen in test mode (unpublished) with myself added as a test user. This worked perfectly for years. In fact, I even tried this again to see if that would solve my problems this time - I got a slightly different authorisation screen during Google’s device auth process, but the same error in the end.

Anyway, in a moment of stupidity last night, I removed the integration. I was setting up some calendar automations and couldn’t see my Google calendars as selectable entities for the calendar.create_event service, so I thought I’d just remove and re-add the integration to see if they showed up. I later realised this is because you need to use google.create_event, but alas, it was too late.

I did make sure to remove my old google_calendars.yaml and .google.token files in /config, and the old “Application Credentials” in the Home Assistant integration settings screen after removing the integration.

At this point, I’m stumped. I set it all up anew last night when I was trying to re-add the integration and instantly ran into this problem. Hoping it may’ve been some provisioning delay, I left it and tried again when I got home from work today.

Nope, nothing, nada, pain.

Maybe I’m just stupid and have done something obviously wrong here. I hope so, but I’m failing to discover the issue.

If anyone has any ideas, please let me know :pray:

Update: I’m an idiot — Tried another browser and it worked. :man_facepalming:

1 Like

Thanks for posting this. I was going crazy trying to figure out what I was doing wrong after also removing and re-adding the calendar integration. Switched from firefox to chrome and it’s fine :man_shrugging:

1 Like