Redirect_uri error for google nest integration error 400 - SOLVED

I’m on 0.118.0 though I tried 0.117.0 too.

I cannot seem to add the nest integration , I get this error:

On the Oauth side I have the url above as set as authorized:

In configuration.yaml

homeassistant:
  external_url: "https://xxx....ui.nabu.casa"
  internal_url: "http://192.168....:8123"

I’m not sure what else I’m missing. I’ve tried to do this via local 192 address and using the nabu.casa address the both have a redirec_uri error issue.

Not sure if it makes a difference but when I use my 192 local ip the error I get is:
Error 400: invalid_request device_id and device_name are required for private IP: http://192.168..30:8123/auth/external/callback

ok this really should be apart of the documentation. (Thanks to someone on discord, I lost their screen name for the help)
The solution using nabu casa is to include the path in your google URI redirect for auth. For example:

This allowed me to add my nest stuff and get around the redirect error. Couple of open issues when trying to add integration:
Windows: firefox or chrome, if using nabucasa to get to the HA pressing + integration does nothing. No menu pops up
IOS: using cloud connection to the HA app on the iphone you can go through all the steps after adding nest but on the last screen of the oauth it does not take you back to the app to finish adding the integration.

What worked: Chrome OS on my mac. It allowed me to add the integration, go through oauth and return to the HA page.

2 Likes

Thank you so much for the url update. I was missing that as well!

I have added:

homeassistant:
  external_url: "https://d199-126-XXX-XXX.abhsia.PROVIDER.net"
  internal_url: "http://192.168.1.XXX:8123"

(XXX’s and Capitals above are just for obscuring private info, they contain the correct values)

I restart the server, get no errors in the logs, and the GUI shows:
image

But when I add the “Nest” integration it isn’t providing the external URL to google and is thus failing:
image

Why is it not using the external URL like the other poster?

I am on 0.118.5 if that matters.

Just in case anyone else finds this and is stuck…

I found the solution in here:

It uses the URL you are accessing the HA console from for the request. so I need to use my external URL to access HA and then setup Nest… Off to try now…

1 Like

I spend today few hours on this problem, finally working.

  1. On Google Cloud oauth url put your Nabucasa url: https://your_id.ui.nabu.casa/auth/external/callback
  2. Login to HA via Nabucasa (not via local name or local ip): https://your_id.ui.nabu.casa
  3. Add “Nest” via integration page.
3 Likes

Thanks for the solution. Logging in through nabu.casa worked for getting the integration made but I’m not getting an entity. It’s not showing my thermostat. Any thoughts?

UPDATE: The log showed that my Subscriber ID wasn’t right. Went back into the Cloud Pub/Sub API page and corrected it. Now it’s working.

I’m very new to Home Assistant, moving over from Smartthings… is it always this complicated?!

Well that indeed worked but now I can’t control Nest from the local/internal URL. Only from the external nabu Casa URL.

THANK YOU!!!
did not realise i had to use nabu casa enviroment to add the Nest intergration, been hours! thank you!

Im interested in understanding if i can use this without having to use the nabu casa address. I ask this because every so often the integration needs to be fixed for an unknown reason.

The only way is for me to login with nabu casa URL and integrate.

Can anyone explain if a local address can be used as a redirect URL?. I cant get it to work.

Google will no longer accept the /auth/external/callback at the end of the URL for nabu casa or anything else. Says it has to be a “top level domain”.

I can’t get past the “uri error page” even when logging in through the nabu casa link.

1 Like

Exact same redirect issue here. Error 400 from google when trying to authorize Nest. The nabu.casa/auth/external/callback no longer accepted. Only top level domains. Anyone with a work around?

I figured out the problem…my external url wasn’t referenced in the configuration.yaml file:

homeassistant:
   external_url: "https://.............ui.nabu.casa/auth/external/callback"
   internal_url: http://192.168.1.92:8123

I can’t tell you how long I spent trying to get this to work, using the nabu casa url finally did the trick. THANK YOU!!

Hi folks, in 2021.12 redirect urls (for OAuth for Web) will no longer be required at all to simplify this. Instead, we’ll use a version of OAuth where you copy/paste an access code (OAuth for Apps). If you used OAuth for Web and redirect urls, that will keep working. Going forward we’ll prefer the simpler OAuth for Apps for new installs.

im getting this error


can anyone here assist with it please <3

Hi,

Is there any additional detail if you mouse over the error message? You can also check out SettingsSystemLogs to see error information about why its failing to setup. See Troubleshooting your configuration - Home Assistant for even more details.

It may be worth forking a separate discussion thread given that this is unrelated to the topic in this thread about the redirect_uri error when configuring the integration.