Nest Authorization Error Error 400: invalid_request

I tried to follow the Web Auth method by nickrupert7 but it turns out its for container-based HA. I’m using HAOS and the steps are surprisingly easy. Here are my steps:

Prerequisite: setup remote access. I already have remote access when setup Google Assistant Integration. If you don’t have remote access yet, there are some good YouTube guides (just search home assistant remote access). You will need: port forwarding, DuckDNS, DuckDNS Add-on and a few lines in configuration.yaml.

After that, moving from Desktop Auth to Web Auth is a few steps away as they are pretty similar. Just follow the old instruction for web auth. Here is the difference between the “old instruction” and the current one:

Create and configure Cloud Project [Cloud Console]: exactly the same, no need to do again;
Configure OAuth Consent screen [Cloud Console]: exactly the same, no need to do again;
Configure OAuth client_id and client_secret [Cloud Console]: step 3 - choose auth type and step 5 - add authorized redirect URIs are different
Create a Device Access Project [Device Access Console]: step 5 is different (step itself is the same but you use the new client id). Note that you don’t have to pay $5 again; Tip: better to avoid reusing the previous project. I run into OAuth client id mismatch issue when trying to do so.
Pub/Sub subscriber setup: a brand new step, follow the instruction
Configuration: you need to add an additional field subscriber_id, which is from the Pub/Sub step
Device Setup: choose OAuth for Web when adding the integration; the UI will walk you through the rest of the setup.

9 Likes