Giter Club home page Giter Club logo

keycloak-demo's Introduction

Keycloak Demo

This demo shows how to run Keycloak and secure different applications and services.

There are a few bits to the demo and to make it easy to deploy everything it uses MiniShift to make it easy to run everything on a single computer and have everything wired together properly.

Before starting the demo you need to download and install MiniShift. This is as easy as downloading the MiniShift distribution.

Once you have downloaded MiniShift start it up and make sure you install the admin-user addon. For simplicity you can just run bin/start-minishift.sh which will do this for you.

Overview

The demo contains the following parts:

  • Keycloak
  • Node.js REST service
  • PHP REST service
  • HTML5 application

Starting Keycloak

Simply run bin/start-keycloak.sh and Keycloak will be deployed to OpenShift.

To find the hostname of Keycloak run oc get routes keycloak. Then open https:// in your favorite browser.

You can now login to the Keycloak admin console with username admin and password admin.

To configure Keycloak you can either create a new realm in the admin console and import demo-realm.json or run bin/configure-keycloak.sh.

Deploying the Node.js service

The Node.js service is a very simple API that is secured with the Keycloak Node.js adapter.

Simply run bin/start-service.sh and the service will be deployed to OpenShift.

To find the hostname of the service run oc get routes demo-service. Then open https://<hostname>/public in your favorite browser. You can also try https://<hostname>/secured, but this will return a 401 as you are not authenticated at this point.

Deploying the PHP service

The PHP service is a very simple API that is secured with the Keycloak Generic adapter.

Simply run bin/start-service-php.sh and the service will be deployed to OpenShift.

To find the hostname of the service run oc get routes demo-service-php. Then open https://<hostname>/public in your favorite browser. You can also try https://<hostname>/secured, but this will return a 401 as you are not authenticated at this point.

Deploying the HTML5 application

The HTML5 application is a basic web application that is secured with the Keycloak JavaScript adapter. You can login to the application through Keycloak and then securely invoke the Node.js service.

Simply run bin/start-app-php.sh and the application will be deployed to OpenShift.

To find the hostname of the service run oc get routes demo-app. Then open https://<hostname>/public in your favorite browser. Click on the login button and login with username keycloak and password test. Now you can click on the various buttons to invoke different endpoints on the service.

You won't be able to invoke the admin endpoint at this point as the keycloak user doesn't have the required roles. Login to the Keycloak admin console and add the admin role to the keycloak user to be able to do that.

One last fun thing you can try is to change the application to invoke the PHP service instead.

keycloak-demo's People

Contributors

stianst avatar

Watchers

James Cloos avatar David Farias avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.