mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-04-27 00:25:54 +03:00
[GH-ISSUE #980] Authorization Code Flow: Unable to enter URL in production/EOF error #588
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#588
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 @maxmir20 on GitHub (Jun 2, 2023).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/980
Hello,
I am using Spotipy to make my first Django Web App to return a User's currently playing track when a GET API is called with the User's id (on my app, not on the Spotify API). My code works no problem locally, but when I launch it to production in Digital Ocean, no new browser window opens with the Redirect URI and I run into a EOF error in runtimes logs where it doesn't allow me to handle raw_input in the
@staticmethod def _get_user_input(prompt): try: return raw_input(prompt)static method.
I also don't have the same level of console access as I would locally, so even if the redirect callback opened in a new tab, I don't think I would be able to enter it into the console.
I've included SPOTIPY_CLIENT_ID, SPOTIPY_CLIENT_SECRET, and SPOTIPY_REDIRECT_URI as environment variables, which should be called by CLIENT_CREDS_ENV_VARS (I can confirm the information is correct by looking at the logger.debug in runtime logs). And am calling Spotipy.Oauth2 as follows:
Do you have any idea what I could do to solve this problem in production? Either by sidestepping the "Enter URL" step or getting the new window authorization working?
@Avishkar15 commented on GitHub (Jun 19, 2023):
Hey did you find a solution
@maxmir20 commented on GitHub (Jun 19, 2023):
@Avishkar15 ,
I did find a solution but it was by sidestepping the Spotipy process and going through the authentication myself on Django.
I have one API make the authorization request, which opens the window for them to authorize their account. Then when it's complete, the authorize API returns the callback URL. I redirect to that callback URL and have an API in place to grab it and then use the 'code' parameter from the URL to request the access token