Tutorial: User Login and Registration in Ionic 4

Matt Raible

This article is a bit outdated. You might have better luck with Ionic + Sign in with Apple and Google. Note that OktaDev Schematics (which is used to install Okta support in Ionic) now uses cordova-plugin-secure-storage-echo because the previous library is no longer maintained.

Jake Smith

How does one enable self-service registration if they don’t already see it in their admin menu?

Matt Raible

In the current Admin Console, it should be under Directory > Self-Service Registration.

Allamprabhu Aloji

Hello All, How can we integrate this with capacitor? please help me. is it possible to remove capacitor://localhost and make it as http ?

Matt Raible

There’s a more recent tutorial, Ionic + Sign in with Apple and Google, that shows how to use Capacitor.

Jake Smith

Interestingly enough, even though I’m super admin, I did not see it. I had to contact support to have them enable the feature for me, and then it showed up in the menu after that.

Himani Asrani

Hi,

I am facing an issue with Android.
After pressing on Login, the app redirects to Okta page, takes in credentials for sign in and redirects back to the app but still the Sign In button is shown. Session gets created in browser, but there is a problem in token storage due to which user details don’t get displayed on screen.
It works perfectly fine for web.
Any suggestions?

Himani Asrani

Hi Pritam,

I tried your solution and getting the following error:

D/PluginManager: getPlugin - put: SecureStorage
W/KeyStore: get() : not found key : USRCERT_io.ionic.starter.SecretStore
W/KeyStore: get() : not found key : CACERT_io.ionic.starter.SecretStore
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
Process: io.ionic.starter, PID: 21387
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=com.android.credentials.UNLOCK }
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2071)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1717)
at android.app.Activity.startActivityForResult(Activity.java:5250)
at org.apache.cordova.CordovaActivity.startActivityForResult(CordovaActivity.java:352)
at android.app.Activity.startActivityForResult(Activity.java:5208)
at android.app.Activity.startActivity(Activity.java:5579)
at android.app.Activity.startActivity(Activity.java:5547)
at com.crypho.plugins.SecureStorage.startActivity(SecureStorage.java:240)
at com.crypho.plugins.SecureStorage.access$700(SecureStorage.java:21)
at com.crypho.plugins.SecureStorage$4.run(SecureStorage.java:217)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:7948)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1075)
I/Process: Sending signal. PID: 21387 SIG: 9