Okta authentication with Capacitor mobile app

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 and are converting to a custom login page.

In a nutshell the 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

  "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.

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

1 Like

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

@sdunnin we use the Ionic App Auth Library - but see my reply to your post in the Okta Forum