Get your Spotify Access Token
This app uses Authorization Code Flow to authenticate users:
- We generate a unique code that you will use to authenticate to us:
xOfQBZw0dj8KBu5e
- Copy and paste your code in your Val Town Environment Variables as
SPOTIFY_VAL_TOWN_AUTH
- You can pick which scopes to authorize.
- We construct a URL to redirect you to, which will ask you to authorize our app on Spotify.
- You are redirected back to our app, with a code in the URL.
- We exchange the code for an access token and refresh token, which we save.
- You can request your access token at
https://stevekrouse-spotify.web.val.run/token?state=xOfQBZw0dj8KBu5e
- If your access token expires, we use the refresh token to get a new one.
- Use your access token to make requests to the Spotify API.