Implementing Okta Singin on Ionic App

Dear All,
I’m developing an Ionic application and using Okta for user authentication. Initially I used Okta-signin-widget and it was working fine, when I was testing app on browser. After I deployed app to mobile phone, widget is started giving problems, as it was not able to find redirectUri on phone (window.location.origin). Then I took help from the following link. This is working fine, issue is with automatically refreshing tokens. In augular-odic2-oauth, “setupAutomaticSilentRefresh” method is available, but this uses “postMessage”, and i dont know how to handle it in cordova in app browser.
Could you please guide me how to properly implement Okta signin in an Ionic application and
also auto refresh tokens.

Thanks!!
Matt

Here’s a demo for Ionic 4 that might help. https://github.com/mraible/ionic-4-oidc-demo

Hi @mraible is there a sample integration of Okta-signin-widget in Ionic3?

No. Up until now, I haven’t been able to get the Sign-In Widget to work with Ionic when running on a native app. However, we recently added support for using capacitor://localhost as a trusted origin, so it’s possible it’ll work now. I just got back from a long vacation, so it might take me a few weeks to try it out.

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