Oauth flow gives Invalid authorization code error [resolved]

Description
When trying to use the oauth flow, I keep getting an Invalid authorization code error when trying to do the code -> token exchange

Error
response from zoom api:

{"reason":"Invalid authorization code [code from the oauth step]","error":"invalid_request"}

request sent:

:body=>
  {"client_id"=>"[confirmed correct, also tried without this field]",
   "client_secret"=>"[confirmed correct, also tried without this field]",
   :redirect_uri=>
    "https://[ngrok id].ngrok.io/api/v2/auth/zoom/callback",
   :grant_type=>"authorization_code",
   :code=>"[confirmed correct]"},
 :headers=>
  {"Content-Type"=>"application/x-www-form-urlencoded",
   :Authorization=>
    "Basic RHFTTmN[..snip..]ZHgzb3NpeXYwUA=="}}

Which App Type (OAuth / Chatbot / JWT / Webhook)?
Using the OAuth endpoint - we need to auth 3rd parties

Additional context
I see mention of “development credentials” in other threads, but I only see production credentials in the oauth app. Do I need different credentials for testing?

I found that sending the code as a POST body seemed to be causing the error - changing to URL query params solved the issue for me

1 Like

Hey @kieran.huggins,

Happy to hear you figured out the issue! :slight_smile:

Thanks,
Tommy