

If you haven’t made note of these, you will have to go back to your Spotify for Developers dashboard to grab this information. You will need to replace these variable values with your own credentials. On lines 16–18 there are variable declarations for client_id, client_secret and redirect_uri. Performing the exchange of the authorization code for an access token.Specifying the scopes for which authorization is sought.

Creating a server on your local machine.The guide tells us that it contains code for: It also contains embedded Javascript, including jQuery ajax API calls, and event listeners and logic relating to obtaining and saving an access token. There are only two files on this flow - an index.html file in the ‘public’ folder and an app.js file.Ī look through these files reveals that the index.html deals with the login page and with rendering user information on the page. Today I’ll be working with the Authorisation Code flow. The easiest way to get a feel for these different flows is to clone down Spotify’s Web Auth API examples and running each of them on your local server. There are three ways to authorise your app with Spotify - Authorisation Code (refreshable user authorisation), Implicit Grant (temporary user authorisation), and Client Credentials Flow (refreshable app authorisation).
