exportify icon indicating copy to clipboard operation
exportify copied to clipboard

Doesn't work locally

Open axljones opened this issue 2 years ago • 7 comments

When running the project locally, it doesn't work as my internal ip is passed to the spotify API:

ERROR: INVALID_CLIENT: Invalid redirect URI

URI: https://accounts.spotify.com/authorize?client_id=abcd&redirect_uri=http%3A%2F%2F192.168.0.99%3A3000%2Fexportify&scope=playlist-read-private%20playlist-read-collaborative%20user-library-read&response_type=token&show_dialog=false

axljones avatar Sep 08 '23 13:09 axljones

Recently tested using docker on my local, I wasn't able to reproduce this issue with Firefox 115.3.0esr (64-bit). Just writing to provide additional information, PR for docker usage: https://github.com/watsonbox/exportify/pull/148

ozancivaner avatar Oct 04 '23 02:10 ozancivaner

Recently tested using docker on my local, I wasn't able to reproduce this issue with Firefox 115.3.0esr (64-bit). Just writing to provide additional information, PR for docker usage: #148

Did you go through with the import? Did you run this on a server with a publicly reachable ip address?

axljones avatar Oct 06 '23 09:10 axljones

I ran it on my local PC, using;

`docker build . -t exportify

docker run -p 3000:3000 exportify`

And then went to http://localhost:3000/ on my browser. Then I exported a couple of playlists, the data was correct

ozancivaner avatar Oct 06 '23 15:10 ozancivaner

I ran it on my local PC, using;

`docker build . -t exportify

docker run -p 3000:3000 exportify`

And then went to http://localhost:3000/ on my browser. Then I exported a couple of playlists, the data was correct

The dockerfile didn't exist when I tried last time.

I've tried it again and get the same issue. Could you give me the redirect URI you get ?

Especially the value of the redirect_uri parameter.

I'm running the docker image on a local server, not my actual PC.

axljones avatar Oct 06 '23 15:10 axljones

It's in the form of

https://accounts.spotify.com/en/authorize?client_id=[clientid]&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2F&scope=playlist-read-private%20playlist-read-collaborative%20user-library-read&response_type=token&show_dialog=false

Maybe spotify makes an exception for localhost when handling these requests, but not for the IP address of a local server, if you are using an IP address in the local network?

ozancivaner avatar Oct 07 '23 10:10 ozancivaner

It's in the form of

https://accounts.spotify.com/en/authorize?client_id=[clientid]&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2F&scope=playlist-read-private%20playlist-read-collaborative%20user-library-read&response_type=token&show_dialog=false

Maybe spotify makes an exception for localhost when handling these requests, but not for the IP address of a local server, if you are using an IP address in the local network?

Yes, that is exactly what i was thinking originally. I tried using localhost but it didn't work because i didn't specify the port. It worked with your redirect_uri. I then got a new redirect url with a token so i replaced the localhost with my ip. It now loads but seems stuck in a loop. I'll keep this issue updated

http://localhost:3000/exportify#access_token=[access_token]&token_type=Bearer&expires_in=3600

image

axljones avatar Oct 07 '23 10:10 axljones

both selfhost methods (docker & running it directly with yarn) did not work for me. the service hosted on github.io doesn't work either though :( using ungoogled-chromium 119.0.6045.105

awsms avatar Nov 07 '23 22:11 awsms

Converting this to a discussion in case it evolved. I can only guess that there must be something unusual about your browser or extensions causing this issue, since that local redirect URI is valid for the app and works for others.

watsonbox avatar Feb 18 '24 17:02 watsonbox