mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-06-19 09:13:53 +00:00
improve redirect wording and fix minor bugs
This commit is contained in:
parent
4c2c1d763a
commit
cc473caf06
@ -99,16 +99,18 @@ generate an authorization token that indicates that the user has granted
|
|||||||
permission for your application to perform the given task. You will need to
|
permission for your application to perform the given task. You will need to
|
||||||
register your app to get the credentials necessary to make authorized calls.
|
register your app to get the credentials necessary to make authorized calls.
|
||||||
|
|
||||||
Even if your script does not have an accessible URL you need to specify one
|
Even if your script does not have an accessible URL you will need to specify one
|
||||||
when registering your application where the spotify authentication API will
|
when registering your application which the Spotify authentication server will
|
||||||
redirect to after successful login. The URL doesn't need to work or be
|
redirect to after successful login. The URL doesn't need to be publicly
|
||||||
accessible, you can specify "http://localhost/", after successful login you
|
accessible, so you can specify "http://localhost/", and after succesfully
|
||||||
just need to copy the "http://localhost/?code=..." URL from your browser
|
authenticating your app, you can simply copy the
|
||||||
and paste it to the console where your script is running.
|
"http://localhost/?code=..." URL from your browser and paste it to the
|
||||||
|
console where your script is running.
|
||||||
|
|
||||||
Register your app at
|
Register your app at
|
||||||
`My Applications
|
`My Applications
|
||||||
<https://developer.spotify.com/my-applications/#!/applications>`_.
|
<https://developer.spotify.com/my-applications/#!/applications>`_ and register the
|
||||||
|
redirect URI mentioned in the above paragragh.
|
||||||
|
|
||||||
|
|
||||||
*spotipy* supports two authorization flows:
|
*spotipy* supports two authorization flows:
|
||||||
@ -127,7 +129,6 @@ To support the **Authorization Code Flow** *Spotipy* provides a
|
|||||||
utility method ``util.prompt_for_user_token`` that will attempt to authorize the
|
utility method ``util.prompt_for_user_token`` that will attempt to authorize the
|
||||||
user. You can pass your app credentials directly into the method as arguments::
|
user. You can pass your app credentials directly into the method as arguments::
|
||||||
|
|
||||||
util.prompt_for_user_token(username,scope,client_id='your-app-redirect-url',client_secret='your-app-redirect-url',redirect_uri='your-app-redirect-url')
|
|
||||||
|
|
||||||
or if you are reluctant to immortalize your app credentials in your source code,
|
or if you are reluctant to immortalize your app credentials in your source code,
|
||||||
you can set environment variables like so::
|
you can set environment variables like so::
|
||||||
@ -140,7 +141,7 @@ Call ``util.prompt_for_user_token`` method with the username and the
|
|||||||
desired scope (see `Using
|
desired scope (see `Using
|
||||||
Scopes <https://developer.spotify.com/web-api/using-scopes/>`_ for information
|
Scopes <https://developer.spotify.com/web-api/using-scopes/>`_ for information
|
||||||
about scopes) and credentials. This will coordinate the user authorization via
|
about scopes) and credentials. This will coordinate the user authorization via
|
||||||
your web browser and ask for the SPOTIPY_REDIRECT_URI you were redirected to
|
your web browser and callback to the SPOTIPY_REDIRECT_URI you were redirected to
|
||||||
with the authorization token appended. The credentials are cached locally and
|
with the authorization token appended. The credentials are cached locally and
|
||||||
are used to automatically re-authorized expired tokens.
|
are used to automatically re-authorized expired tokens.
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user