Allowing frontend JavaScript POST requests to https://accounts.spotify.com/api/token endpoint

前端 未结 1 1419
死守一世寂寞
死守一世寂寞 2020-12-04 01:24

In order to get an access token for the Spotify API in my web app (as specified by their Web Authorization Flow), I\'ve learned that I have to make a POST reque

相关标签:
1条回答
  • 2020-12-04 02:03

    You can find an example of using express to perform the authentication flow with Spotify on https://github.com/spotify/web-api-auth-examples (see the authorization_code approach).

    You can't get an access token making a client-side request to /api/token. You need to make a request to /authorize, which will redirect to your redirect_uri, which itself will exchange a code with an access token.

    Check that example, which should cover your needs.

    0 讨论(0)
提交回复
热议问题