{"reason":"Invalid request : Redirect URI mismatch.","error":"invalid_request"}

Description
I am getting this below response when trying to call to zoom OAuth to get token.

DEBUG|response is{“reason”:“Invalid request : Redirect URI mismatch.”,“error”:“invalid_request”}

Error
DEBUG|response is{“reason”:“Invalid request : Redirect URI mismatch.”,“error”:“invalid_request”}

Which App Type (OAuth)?
https://zoom.us/oauth/token

Which Endpoint/s?
https://zoom.us/oauth/token

How To Reproduce (If applicable)
Steps to reproduce the behavior:
Http http = new Http();
HttpRequest request = new HttpRequest();
request.setEndpoint(‘https://zoom.us/oauth/token’+’?grant_type=authorization_code’+’&code=’+loggedInUser[0].Zoom_Refresh_Token__c+’&redirect_uri=’+'same as in our app i verified’);
request.setMethod(‘POST’);
request.setHeader(‘Authorization’,‘Basic’+’ '+Authorization);

Screenshots (If applicable)
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Hey @akhilesh

Thanks for posting on the Zoom Devforum! I am still learning, but I will try my best to help answer your question. :slightly_smiling_face:

Checkout these related threads that may have the answer you are looking for:

If these threads did not help, please let us know by replying back here and someone from the Developer Relations team will get back to you shortly.

Thanks,
DeveloperBot

nope not working thanks

Hey @akhilesh,

Please checkout my post here:

If that does not help, please share your the redirect url you are using so I can help debug.

Thanks,
Tommy

Hi @akhilesh,

Can you also please whitelist the full Redirect URL as well (…/services/apexrest…) in addition to the main domain, and let me know if you’re still experiencing the error?

Thanks,
Will

Hey @akhilesh,

I’m getting a 500 error when I try to access your redirect URL. Can you confirm this is publicly accessible and isn’t experiencing any internal server errors?

Thanks,
Will

Hey all figured this out with the help of Will, we need to make sure redirect url,white list has “slash” in the end like below in market place app.

Example:
https://zoom.us/”

=========================================================

Also make sure if you are using state in your URL while getting OAuth Code use the same state in getting access token as well.

For example:

if you are using some thing like below to get Authorization Code

https://zoom.us/oauth/authorize’+’?response_type=code’+’&client_id=xxxxxxxxxxxxxx’+’&redirect_uri=‘https://zoom.us/’+’?state=’+‘test’

Make Sure you do the same state while calling access token end point

https://zoom.us/oauth/token’+’?grant_type=authorization_code’+’&code=’+OAuthCode+’&redirect_uri=’+‘https://zoom.us/’+’?state=’+'test

I wish the documentation is a little clear on state stuff as well

Thanks!

Hey @akhilesh,

Thanks again for sharing your solution here!

Best,
Will

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