mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-04-27 08:35:49 +03:00
[GH-ISSUE #471] Following Getting Started docs, can't authenticate with "Authorization Code Flow" #275
Labels
No labels
api-bug
bug
dependencies
documentation
duplicate
enhancement
external-ide
headless-mode
implicit-grant-flow
invalid
missing-endpoint
pr-welcome
private-api
pull-request
question
spotipy3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotipy#275
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mfeif on GitHub (Apr 14, 2020).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/471
Hi There.
I'm following verbatim the docs here. I have all the env variables set, and a premium account and all of that. I'm using localhost as per the instructions.
The browser can't connect to the redirected URL (which is http://localhost/?code=AQCBPehFt16_roFv...{long hash}) I've pasted the URL from the browser into the console as per the docs, and press return, and nothing happens. No error messages, no feedback, nothing.
Looking around the code, it seems like it is supposed to launch an httpd there, but I can't see it.
If I ctrl-C the script, this traceback results:
I tried using an unprivileged port (http://localhost:8001/) and I get an "INVALID_CLIENT: Invalid redirect URI" message from Spotify.
It doesn't seem like the script is running anything on localhost for the browser to connect to.
I'm on python 3.7.2 and spotipy is 2.11.1, running on macos.
What am I missing? Thanks!
@stephanebruckert commented on GitHub (Apr 14, 2020):
Hi @mfeif, thanks for the report.
You were on the right track as it looks like it works only when a port is specified.
Try to to use 8001 again, but don't forget to also update the redirect URI in https://developer.spotify.com/dashboard/ for it to be
http://localhost:8001Let me know if that works and I will update the doc (or even if you have time feel free to open a PR to update it)
@mfeif commented on GitHub (Apr 14, 2020):
I HAD forgotten to update the url. Thanks. But now I do get back a page that says "Authentication status: successful This window can be closed." But then a crash:
I can try and run this in a debugger to see what's causing the raise.
@stephanebruckert commented on GitHub (Apr 14, 2020):
Can you please share a minimal working example and the environment variable names that you've set? you're still on 2.11.1?
@mfeif commented on GitHub (Apr 14, 2020):
Now it's working :-(
The only thing I did was move the credential stuff into the code rather than ENV because my debugger was of course launching its own process and couldn't see my existing env.
If I find any more examples of where it's not working I'll come back here.
So I guess we can close this, but it doesn't seem like the docs are leading people to a successful "Getting Started". I'm not sure if my theory about privileged ports is correct, but it seems likely.
@jonascj commented on GitHub (Apr 18, 2020):
I've created PR #477 which deals with this issue (it updates the documentation but also changes the authorization process such that it does not hang if one does not specifies a port, i.e. old scripts/applications do not break).