eduardolima93 / angular2-spotify

Angular2 Service to connect to Spotify Web API
MIT License
20 stars 14 forks source link

From May 29 all requests to our Web API will require authentication #5

Open sensodejay opened 7 years ago

sensodejay commented 7 years ago

On 29th May 2017 the /search /tracks /albums /artists and /users (and related) endpoints will start requiring an access token, bringing them in-line with all other Web API endpoints.

https://developer.spotify.com/news-stories/2017/01/27/removing-unauthenticated-calls-to-the-web-api/

m-vdv commented 7 years ago

+1

eduardolima93 commented 7 years ago

thanks!

When I upgrade this to the new version of Angular I'll change the authentication or all endpoints.

m-vdv commented 7 years ago

That's great Eduardo! Thank you :D

ahilti commented 7 years ago

In order to e.g. authenticate the getAlbum API call, just add headers: this.getHeaders(), to

getAlbum(album: string) {
    album = this.getIdFromUri(album);
    return this.api({
      method: 'get',
      >>> headers: this.getHeaders(),
      url: `/albums/${album}`
    }).map(res => res.json());

}