oktadev/schematics

AuthSdkError: Unable to retrieve OAuth redirect params storage

nikasvan opened this issue · 3 comments

Having trouble adding Okta auth to Ionic(Capacitor) app.

I am building Ionic(capacitor)/React mobile app. In documentation it seems that instructions for Okta setup is for Ionic/Angular app.

Below are the steps that I took:

  1. Created an Application in Okta(+ added Login redirect URI)
  2. npm install -g @angular-devkit/schematics-cli
  3. npm i @oktadev/schematics
  4. schematics @oktadev/schematics:add-auth (pasted issuer URL and Client ID)

App works for Web.

Then, I moved to iOS integration.

  1. ionic build
  2. npx cap add ios
  3. npx cap open ios
  4. Added custom scheme to ios/App/App/Info.plist

Then I ran XCode. When I press login button I am being redirected to safari Native browser which opens up Okta login page. I put my credentials(mail,password), app seems to redirect to 192.168.100.2:8100/callback?code="....." where I get this error:

"AuthSdkError: Unable to retrieve OAuth redirect params storage

I am thinking app should redirect back to the mobile app but not sure how it can be done from safari. One thing to point out, I do not have an apple account yet, just testing it out.

This project only supports Ionic + Angular, it does not support Ionic with Vue or React at the moment.

Thanks for the answer @mraible

Do you know, by any chance, if there's any library or some way to implement Okta authentication in Ionic(capacitor)/React app atm?

@nikasvan The Ionic AppAuth project has a React + Capacitor example you could probably use as a guide. https://github.com/wi3land/ionic-appauth-react-demo