pckhib / node-red-contrib-spotify

Node-RED node for Spotify Web API
MIT License
13 stars 16 forks source link

INVALID_CLIENT: Invalid redirect URI #16

Closed codingclemo closed 3 years ago

codingclemo commented 4 years ago

Sorry for opening this issue again, but there is no solution provided in the closed issue that worked for me. I could not manage to set up the redirect URI properly so I am hoping I can get some additional information here.

When I try to authorize the spotify node, I get this error message: INVALID_CLIENT: Invalid redirect URI

I tried setting different Redirect URIs for the spotify app but none worked: http://localhost:1880/spotify-credentials/auth/callback http://localhost:8888/spotify-credentials/auth/callback http://192.168.x.x:1880/spotify-credentials/auth/callback ...

I am grateful for any help. Thanks in advance

In case that information is relevant: I am running node-red in homeassistant on a raspberry pi.

codingclemo commented 4 years ago

How could it be any different. Seconds after I posted this question here (after struggling for a couple of days) I accidentally found a generic solution to this problem which should helps other noobs like me out there:

1) When you get this Invalid redirect URI page, copy the URL from that page 2) Open https://www.urldecoder.org/ and paste the URL in the top box and encode the URL 3) Copy the URL after the part ...&redirect_uri= and before the next & (e.g. &state=) 4) Enter this URI in your spotify app in the redirect URI

For homeassistant users, it could look something like this: http://homeassistant.local:8123/api/hassio_ingress/bla-bla/spotify-credentials/auth/callback

Hope this may help others as well.

Found the solution here: https://community.home-assistant.io/t/new-spotify-integration-error-invalid-client-invalid-redirect-uri/170070/3

dcjona commented 4 years ago

How could it be any different. Seconds after I posted this question here (after struggling for a couple of days) I accidentally found a generic solution to this problem which should helps other noobs like me out there:

  1. When you get this Invalid redirect URI page, copy the URL from that page
  2. Open https://www.urldecoder.org/ and paste the URL in the top box and encode the URL
  3. Copy the URL after the part ...&redirect_uri= and before the next & (e.g. &state=)
  4. Enter this URI in your spotify app in the redirect URI

For homeassistant users, it could look something like this: http://homeassistant.local:8123/api/hassio_ingress/bla-bla/spotify-credentials/auth/callback

Hope this may help others as well.

Found the solution here: https://community.home-assistant.io/t/new-spotify-integration-error-invalid-client-invalid-redirect-uri/170070/3

amazing thank you very much

nortuzar commented 4 years ago

How could it be any different. Seconds after I posted this question here (after struggling for a couple of days) I accidentally found a generic solution to this problem which should helps other noobs like me out there:

1. When you get this Invalid redirect URI page, copy the URL from that page

2. Open https://www.urldecoder.org/ and paste the URL in the top box and encode the URL

3. Copy the URL after the part `...&redirect_uri=` and before the next `&` (e.g. `&state=`)

4. Enter this URI in your spotify app in the redirect URI

For homeassistant users, it could look something like this: http://homeassistant.local:8123/api/hassio_ingress/bla-bla/spotify-credentials/auth/callback

Hope this may help others as well.

Found the solution here: https://community.home-assistant.io/t/new-spotify-integration-error-invalid-client-invalid-redirect-uri/170070/3

Thank you so much!! this fixed the problem, was searching all over internet

shahram7 commented 1 year ago

Hi Everyone, I've done all steps that @codingclemo has written but when i click on "AGREE" I see a message "401: Unauthorized". image

I would be really grateful about any hints. Best Regards