Invalid authorization code xx_p7RJBA with status Bad request when requesting for access token after authozation

Getting Invalid authorization code xxxxxxxxxxxxxxxxxxxxxxxxxxx_p7RJBA with status Bad request when requesting for access token after authozation using https://zoom.us/oauth/token api

Error
StatusCode: BadRequest, Content-Type: application/json;charset=UTF-8, Content-Length: -1)
and
{“reason”:“Invalid authorization code xxxxxxxxxxxxxxxxxxxxxxxxxxx_p7RJBA”,“error”:“invalid_request”}

Response Url: https://zoom.us/oauth/token/?grant_type=authorization_code&code=xxxxxxxxxxxxxxxxxxxxxxxxxxx_p7RJBA&redirect_uri=https:%2F%2Flocalhost:44315%2F

Getting this issue in our both Development and Production environments and all the keys and ids are regenerated and updated in our application.

Hey @siva,

Can you confirm that you’re grabbing the authorization code from the redirect URL after your user installs/authorizes the app? You should be grabbing this from a URL that looks something like this, where zoom.us would be the redirect URL you provided in your App:

Let me know—thanks,
Will

Hi @will.zoom, thanks for your quick reply.

Yes when user authorizes the app, zoom sending an authorization code to the redirect url. The same code we are using to get the use access token.

Sample redirect url:
Production : EventTitans

Development : https://localhost:44315/Home/GetZoomCode?code=CE8ZAxPLIs_TQoFObagTMuANlA_p7RJBA

Hi @siva,

It looks like you might be using a local URL. Please make sure your development redirect URL is available on the internet. Can you try hosting your localhost on a server such as ngrok?

Let me know if this helps,
Will

Hi @will.zoom ,

i will check after hosting our localhost on ngrok.

and can you check the production redirect url below

https://www.eventtitans.com/ZoomAuthorization?code=SJN2fx3MIf_TQoFObagTMuANlA_p7RJBA

Earlier it was working fine but suddenly we started facing this issue in our both development and production environments

Thank you

Hi @siva,

Your base domain (eventtitans.com) works fine for me, but your ZoomAuthorization path throws a 404 error for me. Note that your redirect URL should direct users to a valid page—this can even simply be your landing page/homepage. The code will automatically be appended to your designated redirect URL once the user authorizes your OAuth App.

Thanks,
Will

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.