# Redirect URI required... Why?

**URL:** <https://devforum.okta.com/t/redirect-uri-required-why/230>\
**Category:** OAuth/OIDC\
**Tags:** widget\
**Created:** [July 13, 2017, 6:03pm UTC](https://devforum.okta.com/t/redirect-uri-required-why/230 "2017-07-13T18:03:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nick](https://avatars.discourse-cdn.com/v4/letter/n/f9ae1b/32.png) [@nick](https://devforum.okta.com/u/nick)\
**Post date:** [July 13, 2017, 6:03pm UTC](https://devforum.okta.com/t/redirect-uri-required-why/230/1 "2017-07-13T18:03:47Z")

</div>

I’m building a single-page app using the Okta Sign-in Widget. But there’s a problem: The widget always adds a redirect\_uri parameter even though redirecting is undesirable behavior. (The user may already have navigated somewhere in the app, such as #/systems, where they should remain after logging in.) However, it looks like we HAVE to provide a redirect\_url or we get an error that the redirect\_url parameter is invalid. What should I do?

---

<div class="post-metadata">

**Author:** ![nick](https://avatars.discourse-cdn.com/v4/letter/n/f9ae1b/32.png) [@nick](https://devforum.okta.com/u/nick)\
**Post date:** [July 13, 2017, 6:10pm UTC](https://devforum.okta.com/t/redirect-uri-required-why/230/2 "2017-07-13T18:10:01Z")

</div>

Never mind. The redirect\_uri doesn’t seem to do anything after all.

---

<div class="post-metadata">

**Author:** ![mcguinness](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/mcguinness/32/56_2.png) [@mcguinness](https://devforum.okta.com/u/mcguinness)\
**Post date:** [July 13, 2017, 11:41pm UTC](https://devforum.okta.com/t/redirect-uri-required-why/230/3 "2017-07-13T23:41:18Z")

</div>

The Okta Sign-In Widget uses an extension we made to OAuth to use a hidden iframe with Web Messaging (postMessage) to return OAuth responses instead of page redirects. The redirect\_uri is needed to whitelist the parent page of the widget for the postMessage.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/oktadev/original/1X/589c4c5f80de422d01f47cee7185a7fb8227835c.png) [@system](https://devforum.okta.com/u/system)\
**Post date:** [January 12, 2024, 7:07pm UTC](https://devforum.okta.com/t/redirect-uri-required-why/230/4 "2024-01-12T19:07:34Z")

</div>

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