Functions
|
Asks the user to authorize the authorize your app. |
|
Useful for command-line apps, when you don’t want to use |
Reference
Asks the user to authorize the authorize your app. The authorization flow depends on the type of session to pass. As a side effect, the obtained token is stored in the session.
This function launches a flask app listening to http://localhost:{port}/callback
in a new thread, which once the authorization is completed, sends the received token
to the main thread through a messaging queue; in this way, this function does not require
the user to manually copy and paste the callback URL into your app.
IMPORTANT: to use this function
you need to install optional dependencies through: pip install spotipie[auth-app]
you need to whitelist http://localhost:{port}/callback
in your app callback URLs.
session (Union
[AuthorizationCodeSession
, ImplicitGrantSession
]) – OAuth2 session to authorize
app_name (Optional
[str
]) – name of your application (used in the “success.html” page)
port (int
) – TCP port the server listen to
timeout (int
) – shutdown the server app after this time (in seconds)
OAuth2Token
See Also:
Useful for command-line apps, when you don’t want to use get_user_authorization()
.
Asks the user to authorize your app through the terminal. It requires the user to
manually copy and paste the callback URL into the terminal.