# OAuth user authorization not working inside iframe?

**URL:** <https://devforum.zoom.us/t/oauth-user-authorization-not-working-inside-iframe/13019>\
**Category:** API and Webhooks\
**Created:** [April 14, 2020, 3:40am UTC](https://devforum.zoom.us/t/oauth-user-authorization-not-working-inside-iframe/13019 "2020-04-14T03:40:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lixoaqui](https://avatars.discourse-cdn.com/v4/letter/l/ba9def/32.png) [@lixoaqui](https://devforum.zoom.us/u/lixoaqui)\
**Post date:** [April 14, 2020, 3:40am UTC](https://devforum.zoom.us/t/oauth-user-authorization-not-working-inside-iframe/13019/1 "2020-04-14T03:40:26Z")

</div>

I’m trying to do an integration with my webapp using OAuth zoom API. Starting the Oauth flow to ‘install’ the app for the user and getting the auth code works just fine if I just the ‘Install link’ I get on Manage app \> Install.

The problem appears when I try to use the same URL in an iframe inside my website, where zoom just redirects to a 400 Bad Request page.

This is required because I’m triggering the Zoom installation when the user is in the middle of a form on my webapp and I don’t want to redirect the user to the full Zoom website and then getting back and losing the form state I gathered. I wanted to do this via a modal window with an iframe inside.

Iframe code is very simple:  
`<iframe width="600" height="600" src="@URL"></iframe>`

I’m on Chrome Version 80.0.3987.163

Is this simply not supported or I’m doing something wrong?

Edit: so I managed to get something working using `<iframe sandbox="allow-forms allow-scripts allow-same-origin" width="600" height="600" src="@URL"></iframe>`. But if I click on ‘decline’ it tries to go to [marketplace.zoom.us](http://marketplace.zoom.us) and then it says " **[marketplace.zoom.us](http://marketplace.zoom.us)** refused to connect."

I don’t want to give ‘allow-top-navigation’ because I don’t want the user to leave my website and go to zoom… any tips there?

---

<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 14, 2020, 9:02pm UTC](https://devforum.zoom.us/t/oauth-user-authorization-not-working-inside-iframe/13019/2 "2020-04-14T21:02:19Z")

</div>

Hey @lixoaqui,

The [Zoom OAuth flow](https://marketplace.zoom.us/docs/guides/auth/oauth) is intentionally unsupported in iFrames.

Why do you need this flow to be in an iFrame when there is a redirect URL that will redirect the user back to your site after the install the app?

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![lixoaqui](https://avatars.discourse-cdn.com/v4/letter/l/ba9def/32.png) [@lixoaqui](https://devforum.zoom.us/u/lixoaqui)\
**Post date:** [April 15, 2020, 12:28am UTC](https://devforum.zoom.us/t/oauth-user-authorization-not-working-inside-iframe/13019/3 "2020-04-15T00:28:06Z")

</div>

Thanks!

One of the places where I have a place to ‘connect to zoom’ is basically in the middle of my own form where they connect and then select a webinar. If I just redirect I lose whatever the user already typed on other form inputs. (I know about the state param but that is a lot of work for my use case).

With the sandbox options like I did it kinda works except if the user clicks ‘Decline’ zoom tries to redirect to [marketplace.zoom.us](http://marketplace.zoom.us) and that page refuses to work inside the iframe.

If I add the ‘allow-top-navigation’ to sandbox the Authorization page just breaks from the iframe.

Is this officially not supported? Are there any plans to support it?

Even the authorization page design seems to work quite well inside a modal window/iframe, it’s just that code of it ‘breaking out’ from iframe that prevents a kinda normal usage.

Using the state parameter it’s possible to develop this, I’m just trying to get an ‘official’ no before going into a route that gives me a lot more work 🙂

---

<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 15, 2020, 8:32pm UTC](https://devforum.zoom.us/t/oauth-user-authorization-not-working-inside-iframe/13019/4 "2020-04-15T20:32:28Z")

</div>

Hey @lixoaqui,

> [@lixoaqui](#):
>
> One of the places where I have a place to ‘connect to zoom’ is basically in the middle of my own form where they connect and then select a webinar. If I just redirect I lose whatever the user already typed on other form inputs. (I know about the state param but that is a lot of work for my use case).

I would suggest redesigning the flow to save what the user has typed, or connect the Zoom account after / before they have typed.

> [@lixoaqui](#):
>
> Is this officially not supported? Are there any plans to support it?

There are no plans to support the OAuth flow in an iFrame. [It must be done by navigating the user in the browser.](https://marketplace.zoom.us/docs/guides/auth/oauth#getting-access-token)

> [@lixoaqui](#):
>
> Using the state parameter it’s possible to develop this, I’m just trying to get an ‘official’ no before going into a route that gives me a lot more work

Yes, you could also use the state param. 🙂

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:29pm UTC](https://devforum.zoom.us/t/oauth-user-authorization-not-working-inside-iframe/13019/5 "2020-08-21T20:29:51Z")

</div>

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


