# Okta authentication with Capacitor mobile app

**URL:** <https://forum.ionicframework.com/t/okta-authentication-with-capacitor-mobile-app/236999>\
**Category:** Capacitor\
**Created:** [October 13, 2023, 7:12pm UTC](https://forum.ionicframework.com/t/okta-authentication-with-capacitor-mobile-app/236999 "2023-10-13T19:12:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sdunnin](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sdunnin/32/136902_2.png) [@sdunnin](https://forum.ionicframework.com/u/sdunnin)\
**Post date:** [October 13, 2023, 7:12pm UTC](https://forum.ionicframework.com/t/okta-authentication-with-capacitor-mobile-app/236999/1 "2023-10-13T19:12:16Z")

</div>

Was wondering if anyone is using Okta authentication with their Capacitor mobile app?

We have an Angular SPA and have been using it for a while with the [Okta sign-in widget](https://github.com/okta/okta-signin-widget) and are converting to a custom login page.

In a nutshell the [okta-auth-js](https://github.com/okta/okta-auth-js) SDK API for signing in with credentials utilizes an oath oidc redirect flow and makes a call to an Okta webpage that responds with a redirect. What happens is the app opens the authorize link in a new external mobile browser and the call back redirection for the app with the mobile url scheme (i.e. localhost for Android) is also opened in the browser window.

If I add to the capacitor.config

```auto
  "server" : {
    "allowNavigation": ["dev-xxxxxx.okta.com"]
  }

```

That web page call inside the webview does nothing but open a blank page.

Probably an unusual use case but wanted to throw it out there in case someone else might have traveled this road.

---

<div class="post-metadata">

**Author:** ![mariusbolik](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mariusbolik/32/147773_2.png) [@mariusbolik](https://forum.ionicframework.com/u/mariusbolik)\
**Post date:** [October 14, 2023, 8:06pm UTC](https://forum.ionicframework.com/t/okta-authentication-with-capacitor-mobile-app/236999/2 "2023-10-14T20:06:54Z")

</div>

Hi @sdunnin,

I would recommend using the Capacitor In-App-Browser to open the Sign In Page. This approach works very well for me.

Kind Regards,  
Marius

---

<div class="post-metadata">

**Author:** ![sdunnin](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sdunnin/32/136902_2.png) [@sdunnin](https://forum.ionicframework.com/u/sdunnin)\
**Post date:** [October 19, 2023, 2:15pm UTC](https://forum.ionicframework.com/t/okta-authentication-with-capacitor-mobile-app/236999/3 "2023-10-19T14:15:38Z")

</div>

Thanks, do you know of any examples for using in app browser and integrating with Capacitor app?

---

<div class="post-metadata">

**Author:** ![richardshergold](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/richardshergold/32/91823_2.png) [@richardshergold](https://forum.ionicframework.com/u/richardshergold)\
**Post date:** [November 1, 2023, 8:10am UTC](https://forum.ionicframework.com/t/okta-authentication-with-capacitor-mobile-app/236999/5 "2023-11-01T08:10:45Z")

</div>

@sdunnin we use the [Ionic App Auth Library](https://github.com/wi3land/ionic-appauth) - but see my reply to your post in the Okta Forum
