我正在尝试接收refresh_token
我的 Ionic 应用程序,我成功接收了access_token
.
我从我的 TypeScript 项目中的端点接收code
(authorization_code
或) ,我将它传递给测试如何获取但我收到它的唯一错误。access_token
https://accounts.spotify.com/authorize?client_id=
cURL
refresh_token
curl -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: Basic MzBhNT...ZWIyZWQ=" -d grant_type=authorization_code -d code=BQAjgZOFne3p8PB4ARJkrXtq...kI4xJvhQ7SutZoJqVWILCY -d redirect_uri=http%3A%2F%2Flocalhost%3A8100%2Fmain -X POST https://accounts.spotify.com/api/token
预期输出:
{
"access_token": "NgCXRK...MzYjw",
"token_type": "Bearer",
"scope": ...,
"expires_in": 3600,
"refresh_token": "NgAagA...Um_SHo"
}
但收到错误:
{"error":"invalid_grant","error_description":"Invalid authorization code"}