spotipy-dev / spotipy

A light weight Python library for the Spotify Web API
http://spotipy.readthedocs.org
MIT License
5.03k stars 957 forks source link

Is there a way to avoid the "Enter the URL you were redirected to: " prompt when using OAuth Authorization flow? #974

Closed Ori248 closed 6 months ago

Ori248 commented 1 year ago

Hi. I'm using Spotipy for a project I make, and I have to say it is really convenient and clear. But I struggle with one thing regarding the OAuth authorization flow. In the app I make, my goal is to ask a user to login with their Spotify account, and then immediately proceed. However, I can't simply proceed as there is an input prompt asking me to "Enter the URL you were redirected to". Currently, I haven't found any way to proceed besides copy-pasting the URL, which as far as I understood will be an action the user will have to do before proceeding in my app. My question is as follows: Is there any way to either avoid this prompt completely or automate the URL copy-paste process, so that the user can simply proceed in the app without further interaction after logging in?

Any help is welcomed. Thank you in advance.

dieser-niko commented 1 year ago

add redirect_uri like this:

spotify = spotipy.Spotify(auth_manager=SpotifyOAuth(client_id= "your client id",
                                                    client_secret= "your client secret",
                                                    redirect_uri="http://localhost:8080",
                                                    scope="your scopes"))
Ori248 commented 1 year ago

add redirect_uri like this:

spotify = spotipy.Spotify(auth_manager=SpotifyOAuth(client_id= "your client id",
                                                    client_secret= "your client secret",
                                                    redirect_uri="http://localhost:8080",
                                                    scope="your scopes"))

Hi, and thank you for resolving my issue! For some reason I haven't received a notification about your answer and therefore I've seen it just now. The problem turned out to be that my redirect_uri was in https instead of http lol. Thank you again!

dieser-niko commented 6 months ago

Closing as it appears that your issue has been resolved.