# Okta auth with Ionic 4 not redirecting back to application after login

**URL:** <https://devforum.okta.com/t/okta-auth-with-ionic-4-not-redirecting-back-to-application-after-login/19418>\
**Category:** Questions\
**Created:** [February 16, 2022, 3:55am UTC](https://devforum.okta.com/t/okta-auth-with-ionic-4-not-redirecting-back-to-application-after-login/19418 "2022-02-16T03:55:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![snkakad](https://avatars.discourse-cdn.com/v4/letter/s/a87d85/32.png) [@snkakad](https://devforum.okta.com/u/snkakad)\
**Post date:** [February 16, 2022, 3:55am UTC](https://devforum.okta.com/t/okta-auth-with-ionic-4-not-redirecting-back-to-application-after-login/19418/1 "2022-02-16T03:55:41Z")

</div>

Implementing OKTA auth with ionic 4 using @okta/schematics, app opens in-app browser with OKTA login page and validating user also, but after login redirect to localhost:8100 not opening app after redirection, on inspector it shows [http://localhost:8100/implicit/callback?code={code}&state={state}](http://localhost:8100/implicit/callback?code=%7Bcode%7D&state=%7Bstate%7D) and page showing site cant be reached from actual device, using ionic serve it works perfectly.

---

<div class="post-metadata">

**Author:** ![mraible](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/mraible/32/37_2.png) [@mraible](https://devforum.okta.com/u/mraible)\
**Post date:** [February 16, 2022, 4:47am UTC](https://devforum.okta.com/t/okta-auth-with-ionic-4-not-redirecting-back-to-application-after-login/19418/2 "2022-02-16T04:47:12Z")

</div>

Things should work with Ionic 4, but I’ve been using Ionic 6 lately. Did you follow [these instructions](https://github.com/oktadev/schematics#ionic) for creating a native app? It sounds like you might have your app configured as a SPA app.

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [February 8, 2024, 9:32pm UTC](https://devforum.okta.com/t/okta-auth-with-ionic-4-not-redirecting-back-to-application-after-login/19418/3 "2024-02-08T21:32:21Z")

</div>


