Cannot authorize Google Calendar

I followed the Google Calendar Component Setup instructions, added the component to my configuration and restarted Homeassistant.
I get the persistent notification with the link to click on and the code I should enter.

I click on the link, enter the code and get a HTTP 500:
500. That’s an error.

There was an error. Please try again later. That’s all we know.

Did anyone encounter this before?

Using Google Chrome instead of Mozilla Firefox solved the issue