0
votes

I have been quite lost in the authorization steps in spotify api

I need to make a request that resembles this in Postman:

curl -X "POST" -H "Authorization: Basic ZjM4ZjAw...WY0MzE=" -d grant_type=client_credentials https://accounts.spotify.com/api/token

with headers containing client_id and client_secret (api credentials)

here's how I made the request: enter image description here

enter image description here

those were done according to authorization flow (fourth one in their authorization guide-(implicit grant flow (client credentials flow)) last one in this page: https://developer.spotify.com/documentation/general/guides/authorization-guide/#authorization-code-flow-with-proof-key-for-code-exchange-pkce

1

1 Answers

0
votes

According to the specification for Client Credentials Flow, the header you need to send is like so:

Basic <base64 encoded client_id:client_secret>

So you need to Base64 encode the following string client id, : and client secret together like the following (using the full values):

ba2a...3973:4f1c...c99d

Then add Basic before this and send this as an Authorization Header not individual client_id and client_secret headers.