Closed Avishkar15 closed 2 months ago
Hey, did you add the redirect URI as an environmental variable? The Authorization Code Flow needs you to add a redirect URI to your application on your app dashboard and then this needs to be set during authorization. I think you're getting that error because it can't find the redirect URI when you create the Spotify object. Here is an example:
sp = spotipy.Spotify(auth_manager=SpotifyOAuth(client_id= "your client id", client_secret= "your client secret", redirect_uri="http://localhost:8080", scope="your scopes"))
You can read more about it in the documentation: https://spotipy.readthedocs.io/en/2.22.1/#authorization-code-flow I hope this was helpful to you.
Closing as there is no activity or reply from the author.
I keep getting
EOFError: EOF when reading a line Jun 19 04:57:21 PM Enter the URL you were redirected to: 127.0.0.1 when I try to deploy my app from render
My callback function: @app.route('/callback') def callback(): cache_handler = spotipy.cache_handler.FlaskSessionCacheHandler(session) auth_manager = spotipy.oauth2.SpotifyOAuth(scope=SPOTIPY_SCOPE, cache_handler=cache_handler, show_dialog=True) if request.args.get("code"):
Step 2. Being redirected from Spotify auth page
and my redirect uri is also set properly