# Oauth2 sample project problems req.query.code when redirecting to a hosted url

**URL:** <https://devforum.zoom.us/t/oauth2-sample-project-problems-req-query-code-when-redirecting-to-a-hosted-url/13476>\
**Category:** API and Webhooks\
**Created:** [April 16, 2020, 10:01am UTC](https://devforum.zoom.us/t/oauth2-sample-project-problems-req-query-code-when-redirecting-to-a-hosted-url/13476 "2020-04-16T10:01:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rbudiono](https://avatars.discourse-cdn.com/v4/letter/r/45deac/32.png) [@rbudiono](https://devforum.zoom.us/u/rbudiono)\
**Post date:** [April 16, 2020, 10:01am UTC](https://devforum.zoom.us/t/oauth2-sample-project-problems-req-query-code-when-redirecting-to-a-hosted-url/13476/1 "2020-04-16T10:01:51Z")

</div>

Hi, I am currently in the process of integrating a web based application with Zoom using OAuth2 as referred by the zoom docs.

I have successfully followed [https://github.com/zoom/zoom-oauth-sample-app](https://github.com/zoom/zoom-oauth-sample-app) the sample app with ngrok. This works great and the (req.query.code) contains the code when logging that is also reflected in the redirect url.

However when I tried to switch the redirect url to our web based application req.query.code returns an empty object but successfully redirects me into our application with the code reflected in the given url.

e.g. {redirectUrlpassed}?code=ydYVF60t53\_ulm0ZqhEQRSYOh-AQriGsA

 ![Screenshot (206)](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/2X/0/026ac7a470163cdb19550d13b018ffdf73443a27.png)

here is the screenshot for this the above mentioned issue and as mentioned our log of req.query.code returns an undefined.

Appreciate the help!

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [April 17, 2020, 6:09pm UTC](https://devforum.zoom.us/t/oauth2-sample-project-problems-req-query-code-when-redirecting-to-a-hosted-url/13476/2 "2020-04-17T18:09:01Z")

</div>

Hey @rbudiono,

Is your web based application hosting the sample app code?

Notice the if statement that is checking for the code, that means the code query param is not present once you land on your redirect url.

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![DeveloperBot](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/developerbot/32/12632_2.png) [@DeveloperBot](https://devforum.zoom.us/u/DeveloperBot)\
**Post date:** [August 21, 2020, 8:32pm UTC](https://devforum.zoom.us/t/oauth2-sample-project-problems-req-query-code-when-redirecting-to-a-hosted-url/13476/3 "2020-08-21T20:32:17Z")

</div>

Closed on August 21, 2020, 8:32pm UTC


