更新时间:2021-07-21 07:50:12
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).
您无法获得向/api/token
发出客户端请求的访问令牌.您需要向/authorize
发出请求,该请求将重定向到您的redirect_uri
,该请求本身将与访问令牌交换code
.
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.