New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Best way to use Spotify inside an API? #287
Comments
@Jeoffreybauvin In the Case described by you I would not use When removing all the input-checking and comments from def redirect_user_to_oauth(username, scope=None, client_id=None,
client_secret=None, redirect_uri=None,
cache_path=None):
…
sp_oauth = oauth2.SpotifyOAuth(client_id, client_secret, redirect_uri,
scope=scope, cache_path=cache_path)
…
token_info = sp_oauth.get_cached_token()
if not token_info:
auth_url = sp_oauth.get_authorize_url()
return auth_url
def handle_callback(code):
token_info = sp_oauth.get_access_token(code)
return token_info['access_token'] As an API-Implementor you have to provide the requisite options to After the OAuth2 dance, the user is redirected to the |
For now this provides good inspiration to solve the issue #435 (comment) |
Just added an example here https://github.com/plamere/spotipy/blob/master/examples/app.py |
Doesn't this example need a cache_path or username? |
Hi,
I'm using Spotipy in a Flask API (full rest). I'm trying to use util.prompt_for_user_token for login, and it's working.
But now, I want to create an entrypoint /authenticate, which send me back the URL that util.prompt_for_user_token is trying to open in my browser.
I don't see any information in the documentation to do so. Can I catch this URL without opening my browser ?
The text was updated successfully, but these errors were encountered: