My question:
Is it possible to coerce Postman’s built-in OAuth 2.0 “Refresh Token” function to use the same Client Authentication mode as the “Fetch Access Token” function? As best as I can tell, it always uses Basic Auth to fetch the refresh token.
Details (like screenshots):
I’m using the built-in “OAuth 2.0” Authorization that Postman provides to fetch an access token. Because my OAuth AS is configured to support “form-based” (aka: “post”, or “in-body”) client authentication, I select “Send client credentials in body” as the “Client Authentication” mode and I’m able to fetch the access token just fine:
Here’s the “fetch access token” request after clicking “Get New Access Token” that appears in the Postman console:
POST https://my.oauth.server.com/as/token 200 199 ms
Request Headers
Content-Type: application/x-www-form-urlencoded
User-Agent: PostmanRuntime/7.30.0
Accept: */*
Cache-Control: no-cache
Host: my.oauth.server.com
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Content-Length: 280
Request Body
grant_type: "authorization_code"
code: "some-auth-code"
redirect_uri: "http://localhost/login/redirect-target"
client_id: "my-client-id"
client_secret: "my-client-secret"
So far, so good.
However, when it’s time to refresh the token, either automatically after the access token expires or explicitly when I click the “Refresh” link underneath my selected access token, I’m getting a 401 status code response with an error message that states “unsupported authentication method.”
Here’s the “refresh token” request that appears in the Postman console:
POST https://my.oauth.server.com/as/token 401 115 ms
Request Headers
Content-Type: application/x-www-form-urlencoded
Authorization: Basic GsP...16=
User-Agent: PostmanRuntime/7.30.0
Accept: */*
Cache-Control: no-cache
Host: my.oauth.server.com
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Content-Length: 712
Request Body
grant_type: "refresh_token"
refresh_token: "eyJ...egQ"
Response Body
{
"error" : "invalid_client",
"error_description" : "Request denied: Unsupported authentication method"
}
I’ve already tried:
If I choose “Send as Basic Auth header” when fetching the access token, I get an identical 401 response as shown above. This leads me to believe that if the refresh token request used the same “Client Authentication” mode as the fetch access token request, everything would work as expected.
I’ve also tried looking in the documentation, community forums, and the app’s settings to see if there’s an option for coercing this behavior, but I’m not finding anything.