This example is to demostrate the auth dialog for ADFS using Auth0 and Ionic. This example is best to test on an actual device (e.g. not ionic serve) to test the ADFS authentication dialog from a non-domain computer/device.
Based on Cordova 5, Cordova Android 4.0.0, Cordova InAppBrowser plugin (with customization), MSOpenTech's cordova-plugin-auth-dialog and Auth0's Ionic example.
- Ensure that NodeJS, NPM (included with NodeJS) is installed.
- Create an account on auth0 if you have not already.
- Create / Configure ADFS which uses integrated windows login.
- Create an App and configure to use ADFS setup in step above.
- replace auth0 client id and domain in www/js/auth0-variables.js
- run
ionic start myApp blank, this would create a blank ionic project template. - run
ionic setup sass, this would setup this project to use Sass - add a platform (e.g. android, ios)
- run
ionic plugin add cordova-plugin-whitelist(see Caveats #1) - run
ionic plugin add https://github.com/adrianchia/cordova-plugin-inappbrowser.git, this is because the inappbrowser does not support auth dialog (at the time of this writing), we would have to customize it. - run
ionic plugin add https://github.com/msopentech/cordova-plugin-auth-dialog.gitto add the auth dialog. (See Caveats #2). - copy the www directory from the refresh-token example in auth0 ionic.
- run
ionic build android9 runionic emulate android(orionic run androidif you are running on an actual device or Genymotion)
- Since Cordova 5, Cordova Whitelist plugin has been moved externally, you may need to add the new whitelist plugin via
ionic plugin add cordova-plugin-whitelist - You may need to disable / remove duplicate strings in platforms/android/res/values/authdialog-strings.xml in step 6. search for
SDin the xml files (~ line 764).