Skip to content

Sample repository to showcase Keycloak security mechanisms

Notifications You must be signed in to change notification settings

fturizo/MicroServicesKeycloakDemo

Repository files navigation

Conference Application Demo

This is a small application demo used to showcase integration with a separate Keycloak service to secure a microservices architecture provisioned using the Eclipse MicroProfile framework.

This application domain is to manage the speakers and session talks for a conference event.

Important
The Keycloak realm used by this application should have a client named conference-web. This demo assumes that this client is deployed (along with the Keycloak realm) in http://localhost:8888/. A sample realm configuration file is provided in the keycloak/data directory that can be imported to quickly test the integration in this demo.

This application is composed of:

  • 2 microservices applications:

    • A speaker microservice used to manage the speakers that will talk at the event.

    • A session microservice used to manage the session talks held at the event.

  • A small web application designed as an Angular 16+ SPA that uses the previous microservices.

Keycloak Setup

To run these applications you can easily start a Docker container to setup Keycloak and import the configuration file mentioned above:

> docker run -p 8888:8080 -v ./keycloak/data:/opt/keycloak/data/import:ro quay.io/keycloak/keycloak:21.1.1 start-dev --import-realm

Business Domain

Users that access this application should follow into the next 3 groups, each one mapped to multiple roles defined in the Keycloak realm:

Admin

Administrators of the conference event. They can:

  1. Create new session talks (can-create-sessions)

  2. View all session talks (can-see-sessions)

  3. Delete session talks (can-delete-sessions)

  4. View all registered speakers (can-see-speakers)

  5. Add new speakers (can-add-speakers)

  6. Accept speakers into the conference (accept-speakers)

Speaker

Speakers of talks at the event. They can:

  1. View registered sessions (can-see-sessions)

  2. View all fellow speakers (can-see-speakers)

  3. Register themselves as speakers (speaker, can-add-speakers)

Attendee

Attendees of the event. They can:

  1. View all speakers registered (can-see-speakers)

  2. View all session talks (can-see-sessions)

  3. Attend a session if interested (can-register-to-sessions)

The microservices are configured as Maven projects and can be launched from the command line using the Payara Micro Maven plugin like this:

mvn clean install
mvn payara-micro:start

About

Sample repository to showcase Keycloak security mechanisms

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published