keycloak-scim/examples/cordova
Stian Thorgersen 023b558f43 KEYCLOAK-2527
Cordova not working
2016-02-23 13:32:00 +01:00
..
www KEYCLOAK-2527 2016-02-23 13:32:00 +01:00
.gitignore Updates to keycloak.js, including adding support for Cordova 2014-03-19 16:52:41 +00:00
example-realm.json KEYCLOAK-1385 Introduce end-of-line normalization 2015-07-17 13:46:51 +02:00
README.md KEYCLOAK-1715 Cordova example doesn't work on Cordova 5.x 2015-07-28 08:36:01 +02:00

Basic Cordova Example

Before running this example you need to have Cordova installed with a phone or emulator available.

Start and configure Keycloak

Start Keycloak bound to an IP address available to the phone or emulator. For example:

bin/standalone.sh -b 192.168.0.10

Open the Keycloak admin console, click on Add Realm, click on 'Choose a JSON file', selct example-realm.json and click Upload.

Navigate to applications, click on 'Cordova', select 'Installation' and in the 'Format option' drop-down select 'keycloak.json'. Download this file to the www folder.

Download '/js/keycloak.js' from the server to the www folder as well. For example:

wget http://192.168.0.10:8080/auth/js/keycloak.js

Install to Android phone or emulator

mkdir platforms plugins
cordova plugin add org.apache.cordova.inappbrowser
cordova plugin add cordova-plugin-whitelist
cordova platform add android
cordova run android

Once the application is opened you can login with username: 'user', and password: 'password'.