Recieving 'Could not authenticate with provided credentials' during OAuth flow, everything seems right

Hi All,

I know this is similar to #47212 but there’s no resolution there.

I’m trying to setup an OAuth flow, and for the most part it works fine, but it’s the post to /oauth2/token that fails, the only POST request in the process

I tried it using curl too with:

curl -X POST ‘https://api.monzo.com/oauth2/token’ -H ‘Accept: /’ -X POST --data ‘grant_type=authorization_code&client_id={clientid}&client_secret={secret}&redirect_uri={redirectURI}&code={code}’

where anything in {} has been redacted, but was in the actual request and correct. No matter what I keep getting

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

I’ve verified the client secret and ID are correct, the client is created and everything.

The only other API POST request I’ve tried (to /feed) also failed, is there something I’m missing (like a header) for post requests?

Thanks

Hi Hough,

Thanks for the response,

It’s not a very specific error is it?

I don’t think that’s the case, as I initially tried it with an xhttprequest in-browser, and when I first tried with curl I was spoofing the user-agent, so Monzo would’ve seen it as a web browser and not curl.

I managed to get it working by creating another OAuth client… Not sure why that made a difference but it works now. Thanks for the help @hough