OktaDev Schematics 0.9.0: Now with React Native Support!

We released v0.9.0 of OktaDev Schematics today. This release includes React Native support and updates all Okta SDKs to the latest versions. It now defaults to authorization code flow with PKCE instead of implicit flow.

React Native support is provided by Okta’s React Native SDK.

You can try it out today with the following commands:

npm install -g react-native-cli @angular-devkit/schematics-cli
react-native init SecureApp
cd SecureApp
npm install @oktadev/schematics
schematics @oktadev/schematics:add-auth --issuer=https://{yourOktaDomain}/oauth2/default --clientId={yourClientId}

To get the values for {yourOktaDomain} and {yourClientId}, you can follow the instructions for React Native (pasted below for your convenience).

Create an Application in Okta

Log in to your Okta Developer account (or sign up if you don’t have an account).

  • From the Applications page, choose Add Application.
  • On the Create New Application page, select Native as the platform and click Next.
  • Give your app a memorable name, and click Done.
  • Click the Edit button and add a Logout redirect URI that matches the default Login redirect URI (e.g., com.okta.dev-123456:/callback).
  • Click Save.

Copy your issuer (found under API > Authorization Servers), and client ID into the command above and run it.

Please let us know if you find any issues!

I ran this script to create a new app but I’m getting an authorization error: "{error_message: {Authorization error", error_code: "-600"}
The app runs (I’m using an Android device), and the login button shows, but when pressing it, I get the auth error after a short delay. The browser does not open.
I’ve looked at the code and settings, all look like they’ve been set correctly by the script.

Any ideas would be much appreciated…

Thanks!

What version of React Native are you using? If it’s 0.61+, you need to use @oktadev/schematics 1.0.0.

I’m using RN v0.61.4 and @oktadev/schematics v1.0.1.

"dependencies": {
        "@okta/okta-react-native": "1.2.1",
        "@oktadev/schematics": "^1.0.1",
        "react": "16.9.0",
        "react-native": "0.61.4"
    }

For anyone else that sees this in future, I got this working by recreating my AVD and following this tutorial:

@mraible: Thanks!