Demo authorization code flow using Spotify API.
-
Run the following command to install the dependencies
lein install
-
Also install ngrok
npm install -g ngrok
-
Sign up for an ngrok account and get an auth token. Configure the auth-token for your ngrok client.
ngrok authtoken <your authtoken>
-
Start ngrok by running
ngrok http 3000
-
Configure in Spotify developer dashboard the Redirect URIs callback to the forwarding address.
http://.ngrok.io/callback
-
Copy
env_template
to.env
and set the actual values.cp env_template .env
Run the following command to start the service
lein run
Then visit http://localhost:3000/start in your browser.
You should be redirected to login to spotify.
After successful login, you're redirect to a page with the response from request to fetch the access token.
The access token can be used for other requests to Spotify API resource endpoints.