Let's code

Now that we have already created our app in the Auth0 dashboard, it's time to write the code for it. Take the following steps:

  1. Now, create a new MySimpleAuth app using the blank template, as shown in the following code, and go to the MySimpleAuth folder:
$ ionic start MySimpleAuth blank$ cd MySimpleAuth
  1. Install auth0.js and auth0/cordova npm packages, which are required for Auth0 authentication:
$ npm install auth0-js @auth0/cordova --save
  1. We also need to install the following Cordova plugin:
$ ionic cordova plugin add cordova-plugin-safariviewcontroller$ ionic cordova plugin add cordova-plugin-customurlscheme --variable URL_SCHEME={YOUR_PACKAGE_ID} --variable ANDROID_SCHEME={YOUR_PACKAGE_ID} --variable ANDROID_HOST={YOUR_DOMAIN} ...

Get Ionic Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.