I'm trying to get access token as described here -> https://help.salesforce.com/s/articleView?id=sf.remoteaccess_oauth_refresh_token_flow.htm&type=5
Everything works fine as long as I send request like this one:
curl.exe -XPOST 'https://login.salesforce.com/services/oauth2/token' -d "client_id=<my_client_id>" -d "client_secret=<my_client_secret>" -d "grant_type=refresh_token" -d "refresh_token=<my_refresh_token>"
however if I try
Instead of sending client credentials as parameters in the body of the refresh token POST request, you can use the HTTP Basic authentication scheme. This scheme’s format requires the client_id and client_secret in the authorization header of the post as follows:
Authorization: Basic64Encode(client_id:secret)
The client_id and client_secret are separated with a colon (:). For more information, see the OAuth 2.0 Authorization Framework.
curl.exe -XPOST 'https://login.salesforce.com/services/oauth2/token' --header "Authorization: Basic64Encode(<my_client_id>:<my_client_secret>)" -d "grant_type=refresh_token" -d "refresh_token=<my_refresh_token>"
I've tried with curl and with Golang (because I know Go :)) and I always get this
{"error":"invalid_client_id","error_description":"client identifier invalid"}
when I try second approach.