-
-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to set up redirect URIs? #1
Comments
These would be the places where the environment variable is needed: Deezer:
Spotify:
|
I've managed to patch the python files to load a base URL for the API from an environment variable and use that for the redirect URIs. Spotify authentication is now working, but for Deezer I'm getting the following error:
My request looks like this: Once I manage to get this working I'd be happy to create a PR for this :) |
Okay, it seems like Deezer's Edit: it seems like mDNS resolution does not work from the ultrasonics python server / docker image, so you'll have to use the actual IP there (in the ultrasonics settings on the website), otherwise the initial auth will work, but renewing tokens will not, because for that the ultrasonics server has to make a request to the ultrasonics-api server :) |
Hi i am trying to setup the api rn, but i cant access the spotify auth site and I don't know how to do it, and you said you got it running, could you please help me out |
This might not be enough to help you out, if you still have problems I can send you some screenshots once I get back to my PC :) |
Yeah local IPs should work for Spotify. What you seem to be missing is the correct path for the redirect URL, it should be http://192.168.2.124:8003/api/auth/spotify and not just http://192.168.2.124:8003 :) |
oh with the auth/spotify aswell |
still doesn't work, could you do some screenshots of your setup |
Nvm works now just had to restart everything |
Great! |
Okay, I'm just baffled now as I'm trying to get the self hosted ultrasonics-api to work on docker. I'm running both on my server and used the given docker commands to run the containers with api keys and secrets. I have entered ultrasonics-api URL as: http://server_ip:8003/ in the Ultrasonics settings screen and added http://server_ip:8003/spotify/auth/request to Spotify api Redirect URIs. I also tried https://ultrasonics-api.mydomain.com/ in Ultrasonics settings and in https://ultrasonics-api.mydomain.com/spotify/auth/request in Spotify. I've restarted both Ultrasonics and the api container after changes just to be sure. Every time I try to authenticate with Spotify it gives me a "Not found" page. Is there a problem with the api container or what might cause this behavior? |
Ok, I got it to work. Then I added I hope this helps someone struggling to get this to work! |
I can't find documentation on this and my attempts so far didn't work out.
I've set up the API server on my server, accessible on port X. I get the default response when navigating to
/api
as well, so that seems to work as expected.I've configured applications for both Spotify and Deezer on their respective dashboards and used the IDs and keys for the necessary environment variables.
Now I'm stuck at the redirect URIs. I've configured the Spotify one to :X/api/spotify/auth, which I took from here.
In that function it seems like the redirect URI is hard-coded to the heroku instance, although I could be wrong.
I did the same for deezer, and this time there was no hard-coded backlink in the auth function.
Now, when I go to ultrasonics and try to authenticate with Spotify or Deezer, I always end up with an error saying "INVALID_CLIENT: Invalid redirect URI" (for Spotify) or "You must specify a valid redirect URI" (for Deezer).
But I have a redirect URI set up on the developer dashboard for both applications.
Are IPs not allowed for these redirect URIs? Given that the client is being redirected and has access to that local IP, it should technically work, right?
Some more documentation on the matter would be really helpful if we are to migrate away form the heroku-hosted API :)
Edit: Looking at the URL that is used to send the authentication request (to Spotify's/Deezer's website), it seems like the heroku instance URI is hard-coded for both services. Could this be changed please, for example by adding an environment variable for it?
The text was updated successfully, but these errors were encountered: