Go to file
jperez 0d7878f84f Minor updates
- Rename secret_key to client_secret
- Fetch values from new fields
- Authorization Code: Exchange code by token sending id and secret
  in body instead of Base64 header
2014-06-03 13:26:18 +02:00
authorization_code Minor updates 2014-06-03 13:26:18 +02:00
client_credentials Minor updates 2014-06-03 13:26:18 +02:00
implicit_grant Minor updates 2014-06-03 13:26:18 +02:00
.gitignore first commit 2014-05-14 10:27:27 +02:00
app.js first commit 2014-05-14 10:27:27 +02:00
package.json first commit 2014-05-14 10:27:27 +02:00
README.md Minor updates 2014-06-03 13:26:18 +02:00

Spotify Accounts Authentication Examples

This project contains basic demos showing the different oAuth2 flows for authenticating against the Spotify Web API.

These examples cover:

  • Authorization Code flow
  • Client Credentials flow
  • Implicit Grant flow

Installation

These examples run on Node.js. On its website you can find instructions on how to install it. You can also follow this gist for a quick and easy way to install Node.js and npm.

Once installed, clone the repository and install its dependencies running:

$ npm install

Running the examples

In order to run the different examples, open the folder with the name of the flow you want to try out, and run its app.js file. For instance, to run the Authorization Code example do:

$ cd authorization_code
$ node app.js

Then, open http://localhost:8888 in a browser.

Using your own credentials

The examples contains a working client ID and secret key. Note, however, that they might be rate limited if they are used frequently. If you are planning to create an application, we recommend you register your app and get your own credentials instead of using the ones in this project.

Go to My Applications on Spotify Developer and create your application. For the examples, we registered these Redirect URIs:

Once you have created your app, replace the client_id, redirect_uri and client_secret in the examples with the ones you get from My Applications.