I used spotify token api method with authorization code to get a token and refresh token with permissions of my user. (authorization flow)
Here is the request i made with my nodejs app (console log) :
Request {
2017-05-18T23:16:45.861879+00:00 app[web.1]: host: 'accounts.spotify.com',
2017-05-18T23:16:45.861879+00:00 app[web.1]: port: 443,
2017-05-18T23:16:45.861879+00:00 app[web.1]: scheme: 'https',
2017-05-18T23:16:45.861880+00:00 app[web.1]: queryParameters: undefined,
2017-05-18T23:16:45.861880+00:00 app[web.1]: bodyParameters:
2017-05-18T23:16:45.861881+00:00 app[web.1]: { grant_type: 'authorization_code',
2017-05-18T23:16:45.861881+00:00 app[web.1]: redirect_uri: 'https://octave-spotify.herokuapp.com/callback',
2017-05-18T23:16:45.861884+00:00 app[web.1]: code: 'AQASbjsig7owAPhq_ICQSAv1d6iOb0NdB1dqI0M8EQPyjNyv3Dyq4wY8QndzD_Iyykzm9f4lO5xNklltmKBlnKFko3kYeuBm_w1EBlX9_tcMpK6Pg4g-mcAbTdHrArbYJfDCV5LFt-bI5JbPXbxAnfcaHSoto2lk2p6YdQC3EC5Y5FIFBXdCkE4WeZmsPWoDLhQxIMqb8FLrao4-spPq4esE-Btqg73adXyWqU3eO-7MF3291wExc0nFeVK_vefPfH4SbXvFyxmKoHKSOM5etChalj3WMsger9FA6TrPNt5CsAMHNiczW692mfquFapjh516tIgCHzgxPbocN_1xeg6dqvNvUtZ6jjoMW4TQ1j9gAf-B3LXLjCApgSSjqjj53RppFMbF6edv74Ds' },
2017-05-18T23:16:45.861885+00:00 app[web.1]: headers: { Authorization: 'Basic MDE1N2MxYjkwNWU5NDk2YTgzZjViOTM2M2IxNzU5ZmI6ZmJkNGNmYWZlMzNjNDczNGFjMzRjNGYyNTQyMDI2NmI=' },
2017-05-18T23:16:45.861886+00:00 app[web.1]: path: '/api/token' }
2017-05-18T23:16:45.934575+00:00 app[web.1]: Something went wrong authorizationCodeGrant! { [WebapiError: Bad Request] name: 'WebapiError', message: 'Bad Request', statusCode: 400 }
The return expected was a token and refresh token, but i get an api error 400 bad request. I checked my client_id, secret_id and redirect_uri, they seems all good.
Do you have any idea what is the problem ? Thank you for your help.