Yooooomi / your_spotify

Self hosted Spotify tracking dashboard
GNU General Public License v3.0
3.12k stars 125 forks source link

INVALID_CLIENT: Invalid redirect URI when logging to Spotify (unRAID) #204

Closed rh535 closed 1 year ago

rh535 commented 1 year ago

I am running into "INVALID_CLIENT: Invalid redirect URI" when I try to login for the first time. I have included my unRAID docker config screenshot and my Spotify dev settings.

The URL when I click login" https://accounts.spotify.com/authorize?response_type=code&client_id=MY NUMBER *********&scope=user-read-private%20user-read-email%20user-read-recently-played%20user-modify-playback-state%20playlist-modify-private%20playlist-modify-public&redirect_uri=http%3A%2F%2F192.168.1.11%3A2392%2Fapi%2Foauth%2Fspotify%2Fcallback

I can't wait to get this up and running. Thanks for the great app

garrettmueller commented 1 year ago

Same issue here was well. Unraid didn't like that my HTTPS port was 443 even though no other dockers are using it so I changed to 442.

I have my servers local host name (I don't use the IP or local host I have it set as a name in the unraid settings)

Do I need to use the IP?

Edit: Have tried with localhost my servers name I use in for web access (gnas) and tried with IP no luck. Getting 502 bad gateway sometimes and 404 othertimes.

BradSimard commented 1 year ago

Same issue here.

I'm using an external accessible IP for my callback and I still get the error.

Yooooomi commented 1 year ago

Hello, as we can see in the url you have, linuxserver is expecting /api/oauth/spotify/callback. I think just adding the api prefix should fix the whole thing.

BradSimard commented 1 year ago

Hello, as we can see in the url you have, linuxserver is expecting /api/oauth/spotify/callback. I think just adding the api prefix should fix the whole thing.

Worked for me.

Docs should probably be updated as they don't seem to mention every endpoint is prefixed with /api

Yooooomi commented 1 year ago

Doc is for this repo. I checked their repo and they state it.

BradSimard commented 1 year ago

Doc is for this repo. I checked their repo and they state it.

image

Yooooomi commented 1 year ago

Yes, if you use the docker-compose example in this repo, client and server are separated, you can host your server wherever you want, meaning you can have any endpoint. That's why I wrote corresponding to your server location and adding the suffix. In their repo, they bundle it with the client, and expose the api under /api.

image
rh535 commented 1 year ago

I appreciate your help Yooooomi! Adding /api fixed it!

garrettmueller commented 1 year ago

Thank you. I will try this when I get home from class.