2
votes

I'm using the Spotipy library, which uses the Spotify API. When I attempt to get my access token using the 'Authorization Code Flow', I get sent to a spotify web page that asks for me authenticate the access of the app to my user's data. When I click the Okay button, that's supposed to redirect me to my redirect_uri with the access token, it simply does nothing. I get no error message or anything. When I click the Cancel button, I do get redirected to my redirect_uri page, but I don't receive the access token. Is this a bug with the API? Am I doing anything wrong?

I added the redirect_uri to the whitelist of redirect pages in my app's page by the way.

1
Are there any console errors on the Spotify Accounts page?arirawr
I get the following error during the initial loading of the page: Refused to load the script 'data:application/javascript;base64,KGZ1bmN0aW..(long base64)' because it violates the following Content Security Policy directive: "script-src 'self' d2d1dxiu3v1f2i.cloudfront.net google-analytics.com". When I click the Okay button I get the following error: POST accounts.spotify.com/en/authorize/accept 500 (Internal Server Error)Noam A
Ok - I believe that's an internal Spotify error. Is it still happening?arirawr
It's still happening, yes.Noam A
This is the link. token = util.prompt_for_user_token(USER, scope, client_id='2eb6f769c3bd4297a445fc13a4311b33',client_secret='<my_secret>', redirect_uri='localhost/'). This is the spotipy line that prompts the accounts.spotify page. Thanks for your help!Noam A

1 Answers

-1
votes

The answer for this for future readers: Make sure your redirect_uri is EXACTLY the same as the one you have saved in the developer dashboard, right down to the http and the trailing slash.