Skip to content

Instantly share code, notes, and snippets.

@corinnekrych
Last active December 12, 2016 09:42
Show Gist options
  • Save corinnekrych/bade9cd04578de8ce05a4e457914ebe4 to your computer and use it in GitHub Desktop.
Save corinnekrych/bade9cd04578de8ce05a4e457914ebe4 to your computer and use it in GitHub Desktop.

Keycloak on OS v2

TODO: do the same with OSv3

Pre-requisites

gem install rhc
  • login to rhc

Create you KC instance

$ rhc app create keycloak http://cartreflect-claytondev.rhcloud.com/github/keycloak/openshift-keycloak-cartridge

Your application 'keycloak' is now available.
  URL:        http://keycloak-ckrych.rhcloud.com/
  SSH to:     [email protected]
  Git remote: ssh://[email protected]/~/git/keycloak.git/
  Cloned to:  /Users/corinne/keycloak

It will create an instance on you openshift account. For ex: https://keycloak-ckrych.rhcloud.com/auth

  • create a first admin user:
ssh [email protected]
./add-user-keycloak.sh -u corinne

I've created corinne / password

OAuth/OpenId - Create a realm/user/client app to work with Jim's demo

Pre-requisites

  • Have a KC 2.3.0 instance running (see previous step)
  • Have a RHMAP cluster running. We use demo cluster. Ask corinne to grant access, any cluster willdo.

Create RHMAP apps

NOTE: 'auth-server-url' has been changed to https://keycloak-ckrych.rhcloud.com/auth

A project hellosecuredworld has been created with the correct config. You can reuse it for demo.

Note: you will have to change auth-server-url and realm-public-key to match the one from your Keycloak app.

Create KC clients

  • Login as corinne / password
  • Hover on 'Master' releam (lef hand side), Click button 'Add Realm'
  • Give a name, click 'Create' button
  • Go to 'Clients' menu, to create the corodova client app
    • name: cordovaKeycloakDemo
    • valid redirect URIs: http://localhost
    • click 'save' button
  • Go to 'Clients' menu, to create the cloud app to secure our end point
    • name: RHMAPKeycloakDemo
    • Access-Type: bearer-only
    • click 'save' button TODO: we could import those settings for easy setup env as test.

Create KC users

  • On 'Manage | Users' menu, click 'Add user' button
  • username: user
  • email: [email protected]
  • first name: user_first_name
  • last name: user_last_name
  • Select 'credential' tab
    • new passwor: password
    • old password: password
    • hit 'reset password' so that your user has an password

Cordova app

  • run on iOS
cordova platform add ios; cordova run ios

Cordova Keycloak for iOS/Android animated gif

TODO windows...

  • run on Android
cordova platform add android; cordova run android

Web app

TODO based

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment