[GH-ISSUE #59] Cannot authenticate due to bad authentication URL #29

Closed
opened 2026-02-27 23:20:28 +03:00 by kerem · 1 comment
Owner

Originally created by @davecarpie on GitHub (Jun 28, 2015).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/59

When I try authenticate a user I get an unexplained error when visiting the authentication URL.

After investigating this I found that when urllib encodes a redirect URL it removes the 'http://' from the beginning e.g. 'http://davecarpie.github.io' becomes 'davecarpie.github.io' rather than 'http%3A%2F%2Fdavecarpie.github.io'.

I tried authenticating manually using the url with the http:// in it and was successful. When registering a new application Spotify also forces you to have the protocol in the URI so I'm fairly sure that is the reason authentication is unsuccessful.

Using the requests library encodes the URI properly so using that instead of urllib could work? I'm happy to make the change and submit a pull request if you want?

Originally created by @davecarpie on GitHub (Jun 28, 2015). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/59 When I try authenticate a user I get an unexplained error when visiting the authentication URL. After investigating this I found that when urllib encodes a redirect URL it removes the 'http://' from the beginning e.g. 'http://davecarpie.github.io' becomes 'davecarpie.github.io' rather than 'http%3A%2F%2Fdavecarpie.github.io'. I tried authenticating manually using the url with the http:// in it and was successful. When registering a new application Spotify also forces you to have the protocol in the URI so I'm fairly sure that is the reason authentication is unsuccessful. Using the requests library encodes the URI properly so using that instead of urllib could work? I'm happy to make the change and submit a pull request if you want?
kerem closed this issue 2026-02-27 23:20:28 +03:00
Author
Owner

@davecarpie commented on GitHub (Jun 29, 2015):

Apologies, this was a mistake in my code. Please delete the issue if its how you manage this repo

<!-- gh-comment-id:116362120 --> @davecarpie commented on GitHub (Jun 29, 2015): Apologies, this was a mistake in my code. Please delete the issue if its how you manage this repo
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotipy#29
No description provided.