Get your Spotify Access Token

This app uses Authorization Code Flow to authenticate users:

  1. We generate a unique code that you will use to authenticate to us: Eus5HvwUKaXP1YVb
  2. Copy and paste your code in your Val Town Environment Variables as SPOTIFY_VAL_TOWN_AUTH
  3. You can pick which scopes to authorize.
  4. We construct a URL to redirect you to, which will ask you to authorize our app on Spotify.
  5. You are redirected back to our app, with a code in the URL.
  6. We exchange the code for an access token and refresh token, which we save.
  7. You can request your access token at https://stevekrouse-spotify.web.val.run/token?state=Eus5HvwUKaXP1YVb
  8. If your access token expires, we use the refresh token to get a new one.
  9. Use your access token to make requests to the Spotify API.
Get started

If you get in a broken state, you can always remove access to this app from your Spotify account.