Google and Amazon integrations URL redirect issue?

I had similar issue long time ago but i figured, things changed in a past year significantly.

In short, this is what i was trying to do for Amazon integration: https://youtu.be/T_jnNsNvnco and for Google Nest integration https://youtu.be/RwZmQ7QfhsM

And in both cases, i had the url redirect issue.

My HA is accessible from outside via dedicated URL and port and proper SSL set and in use.

I have the same url set in homeassistant: → internal_url: and external_url:

I have tried using Link to OAuth2 Authorize Callback – My Home Assistant the same url is also set in https://my.home-assistant.io

Although, when i open in browser Link to OAuth2 Authorize Callback – My Home Assistant i get “Invalid parameters given.”. I suppose it expects POST and it redirects me to Create a link – My Home Assistant to “Create a link” and i have no clue if i should create something there.

So, both, google and amazon fail to do the redirect.

I suppose it could be the same issue.

Google:Error 400: redirect_uri_mismatchYou can’t sign in to this app because it doesn’t comply with Google’s OAuth 2.0 policy.If you’re the app developer, register the redirect URI in the Google Cloud Console.Request details: redirect_uri=https://my.ha.com:8123/auth/external/callback

Amazon:Error: invalid redirect URI

Any idea how to fix this?

Thnx

I’ve got the same exact problem trying integrate Google Nest Thermostat with Home assistant. In API Credentials I added the redirect url of “Link to OAuth2 Authorize Callback – My Home Assistant”, but I too get Invalid parameters given. Hoping someone can help us out.

Looking at the log I see this entry

ClientResponseError: 401, message=‘Unauthorized’, url=URL(‘https://www.googleapis.com/oauth2/v4/token

1 Like

That’s right, i remember that checking the log made me update URL properly. Sadly, now, i can’t figure out much. I’ll try to post later when i recreate the issue, what is happening in the log.

Where do you get that message?

I got it to work, but here is where I found the logs. I went into Settings and then System and then Logs. It was the first one on the top since I didn’t do anything after that error.

To get it to work, after about 10 unsuccessful attempts, I decided to do a fresh start and I restored my Home Assistant from a backup I had saved just before trying to add Google Nest. You may not be able to do that but you can try the rest that I did.

I then deleted everything I created on Google and started from scratch there following the steps from that YouTube video you used. I think my problem was that I used mixed case in the name. Example: I had used Ha-nest instead of all lower case like ha-nest. I think everything is case sensitive. I also noticed when I did a double click to select the Client secret and device access project id to copy/paste, it added a space to the end of the line. I made sure I didn’t have any leading or trailing spaces in any of the copy/paste from Google to Home Assistant the time it eventually worked. When I got to linking the account, it found my nest thermostat and added it to dashboard. Hope it works for you. If you don’t want to restore from a backup, still delete everything from google and do those steps again and make sure you don’t have spaces and letter cases are same. Hope it works for you too.