Unable to exchange auth code for access token

Hey, I’m having a little trouble exchanging the auth code for an access token. The API is responding with a 400 Bad Request:

{
  "code": "bad_request.bad_authorization_code.redirect_uri_mismatch",
  "error": "invalid_request",
  "error_description": "Invalid redirect URI",
  "message": "Invalid redirect URI"
}

The redirect URLs match 100%. It works fine using Postman (I set the redirect URL accordingly). And it worked fine on a previous domain. Please help.

I’ve dumped the response logs from my oauth client, and it seems to be alternating between the above, and the below:

{
  "code": "bad_request.could_not_authenticate",
  "error": "invalid_request",
  "error_description": "Could not authenticate with provided credentials",
  "message": "Could not authenticate with provided credentials"
}

EDIT: nvm looks like this is an implementation detail of the oauth library I’m using. The first request is sending the credentials using basic auth, which fails. And the second request is sending them as form parameters, which fails with the “Invalid redirect URI” error.

Thankfully my existing access tokens continue to work. I am just unable to fetch new ones. It appears as through refreshing expired tokens also continues to work.

Hah, so creating a brand new client with the exact same settings works perfectly fine. Looks like there’s maybe some sort of cache that’s not updated yet.