Issues with Google Authentication for Tasks, Keep Integrations

Hi everyone. I’ve recently been having problems with integrations that access Google services. Any suggestions gratefully received – I’m not sure if it’s due to a problem client-side, or on my HA installation, or with Google Console permissions, or something else.

  1. I’ve had the Google Tasks integration running for a few months. It’s set to “Testing” mode rather than Published, so I have to re-authenticate every week. This has worked fine for months, but now when Home Assistant asks me to re-authenticate, I enter my credentials and click “Continue” but get “400 That’s an error. The server cannot process the request because it is malformed. It should not be retried” on page https://accounts.google.com/signin/oauth/v3/. I have retried multiple times with multiple browsers and devices with the same result
  2. I’m also trying to get the Google Keep integration working, which uses the same authentication process. Rather than an error, it just hangs with a progress bar displayed continuously. Specific steps described in a bit more detail on this issue.

I’ve tried creating a new Published project with a new set of client secrets on Google Console, but with the same results. I’ve also tried deleting and re-creating the Google Tasks integration; this time I go through the same authentication process and get the same vague error message on a slightly different page with the error “Something went wrong. Please try again” :

Oh… and if anyone knows how to successfully verify the app with Google, please let me know. I followed the instructions to enter https://home-assistant.io as the homepage/privacy/TOS page but the verification failed, see below

Update: This seems to be some kind of problem with cookies.

I tried signing in to my Google account for another (non-Home Assistant) purpose and had problems: the sign-in showed a progress bar but never completed, and then timed out after ~30min with no useful error message. I had the bright idea of trying again in Incognito mode, and this time it worked and I was able to sign in (after 2FA verification).

I then tried opening a Home Assistant window in Incognito Mode, deleted Google Task client secret, added the Tasks integration and got to the “Google hasn’t verified this app” page, and this time it succeeded (again with a 2FA check).

I tried signing out of Google in non-Incognito mode, deleted all Google cookies, re-logged in and tried to add the integration in non-Incognito mode, and it failed.

The Google Keep integration set up still hangs when tried in Incognito Mode.

So I have a workaround for one integration, but no idea of the root cause or how to solve it.