akhilesh
(Akhil)
September 2, 2020, 2:11pm
1
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.
Checkout these related threads that may have the answer you are looking for:
Description
I’m getting a Redirect URI mismatch error when trying to get an access token after getting the code. It’s probably because I misunderstood how redirect URI works. I tried the following:
Exact same URI as in app settings
Same URI that I provided in oauth/authorize call when getting the code
I’m getting the same error every time.
Error
{
“reason”: “Invalid request : Redirect URI mismatch.”,
“error”: “invalid_request”
}
Which App Type (OAuth / Chatbot / JWT / Webhook)?
OAut…
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
tommy
(Tommy Gaessler)
September 4, 2020, 9:25pm
5
Hey @akhilesh ,
Please checkout my post here:
Hey @Nad ,
Let me know if this helps explain things:
The Redirect URI needs to be the same URI from the authorization (install URL) through to the Get Access Token request. So with these URLs set:
[Screen Shot 2020-07-23 at 10.02.37 AM]
When I go to install the app from the “Activation” page, it defaults the redirect URI to the one specified in the “Redirect URL for OAuth” input:
https://zoom.us/oauth/authorize?response_type=code&client_id=ztmR8sxaSBGZ66b5laR7Ag&redirect_uri=https://zoom.u…
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
will.zoom
(Will)
September 14, 2020, 6:42pm
9
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
akhilesh
(Akhil)
September 17, 2020, 2:09pm
14
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!
will.zoom
(Will)
September 18, 2020, 5:55pm
15
Hey @akhilesh ,
Thanks again for sharing your solution here!
Best,
Will
system
(system)
Closed
October 19, 2020, 3:55am
16
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.