-
Notifications
You must be signed in to change notification settings - Fork 0
Home
This repository hosts a legacy, functional workshop guide for deploying and configuring Red Hat Single Sign-On (RH-SSO v7.6.x) / Keycloak (v18.x).
Welcome to the Keycloak / Red Hat Single Sign-On (RH-SSO) Demonstration Project.
This repository serves as a comprehensive, hands-on workshop designed to bridge the gap between Identity Management Infrastructure and Secure Application Development.
Unlike simple "Hello World" tutorials, this project demonstrates a complete, end-to-end integration scenario. You will learn how to deploy a High-Availability (HA) Identity Provider cluster and use it to secure a distributed application architecture using standard OpenID Connect (OIDC) flows.
This project utilizes Keycloak 18.x (RH-SSO 7.6.4) and focuses on the monolithic "Standalone-HA" deployment model. It serves as the conceptual predecessor to our modern, cloud-native RHBK Multi-Site SSO Workshop.
While the server version is older, the concepts, terminology, and OIDC workflows detailed here remain the industry standard and are essential.
This workshop is divided into three distinct perspectives, allowing you to master the full security lifecycle:
Learn the "Server Side" of Identity Management.
- Core Architecture: deploying Keycloak in a clustered mode with an external PostgreSQL database.
- Realm Management: structuring organizations, users, and roles.
- Client Configuration: defining OIDC clients, understanding Access Types (Confidential vs. Public), and managing Redirect URIs.
Learn how to consume Identity in your code.
- OIDC Workflows: implementing the Authorization Code Flow for browser-based front-ends.
- API Security: protecting RESTful back-ends by validating JWT Bearer Tokens.
- Role-Based Access Control (RBAC): extracting claims from tokens to enforce permissions at the code level.
Explore complex deployment patterns and high availability.
- High-Availability (HA): Understanding the Standalone-HA architecture and clustering mechanisms.
- Cross-Site Replication: A brief introduction to multi-site deployments and the challenges of active-active configurations (X-Site).
Use the sidebar navigation to explore the detailed chapters.
| Chapter | Focus | Files Covered |
|---|---|---|
| I. Configuration Guide (Admin) | Installation, Core Server Settings, Database Tuning, and Client Registration. | docs/keycloak/RHSSO_Configuration_Guide.md |
| II. Developer Guide (Dev) | Step-by-step instructions for integrating OIDC into Front-end and Back-end applications. | docs/dev/RHSSO_Developer_Guide.md kc-front-end/README.md kc-back-end/README.md |
| III. Advanced Topics | Exploration of legacy cross-site (xsite) replication concepts and database strategies. | docs/xsite/README.md |
- Modern Evolution: For Red Hat Build of Keycloak (v26+), Cross-Site Replication, and OpenShift/Kubernetes deployments, please visit the RHBK Multi-Site SSO Workshop.
NOTE: This project uses older Keycloak versions(up to v.18) and serves as the conceptual predecessor to the RHBK Multi-Site SSO Workshop.
-
Authorization flows (Grant Type)
- Authorization Code Grant
- Implicit Grant
- Resource Owner Password Credentials Grant
- Client Credentials Grant
-
- Bearer-only
- Confidential
- Public
-
- CORS handling
-
Keycloak client types
-
The Keycloak Realm overview: relations between Roles, Groups, Users, and Cliens.
-
Workflow: Web application (Front-end)
- Case: The front-end application and the back-end service.
- Public client definition
- Case: The frontend and several back-end services
- Case: The front-end application and the back-end service.
-
Workflow: Machine to machine communication(
M2M)-
Confidential client overview.
-
Bearer-only client overview.
-
The Service account setup.
-
The
M2MInteraction Closeup. -
Case: The front-end and several back-end services.
- Front-End: public client.
- Back-end "service A": Bearer-only client.
- Back-end "service B": Confidential client.
-
- Workflow: Web application with Front-end and/or Backend
- Browser based flow explanation
- Keycloak settings example
- Oauth2 Proxy settings example
-
Realm
- Create realm (direct)
- Export realm
- Import realm
- Token
- Authorization flows (Grant Type)
-
Keycloak client
- Create client (direct)
- Create client (import)
-
Valid Redirect URIs
- Valid Redirect URL
- Root URL
- Add or remove URL
-
Web Origins
- CORS configuration
- Client configuration
- Scopes & Claims
-
Roles & Groups
- Role
- Realm roles
- Client roles
- Composite roles
- Group
- Default groups
- Group membership
-
Workflow: Web application (Front-end)
- Case: The front-end application and the back-end service.
- Frontend OIDC Integration, code closeup.
- Backend API Security, code closeup.
- Case: The front-end application and the back-end service.
-
Workflow: Machine to machine communication(
M2M)-
Case: application which consists of a front-end and several back-end services
-
Confidential client overview.
-
Bearer-only client overview.
-
The
M2MInteraction Closeup. -
The Service account
-
Keycloak API call delegation, code closeup.
-
Case: The front-end and several back-end services.
- Front-End: public client.
- Back-end "service A": Bearer-only client.
- Back-end "service B": Confidential client.
- Keycloak API call delegation: The "service account" vs "role overriding" approach, code closeup.
-
- Workflow: Web application with Front-end and/or Backend
- Keycloak settings summary
- Oauth2 Proxy settings summary
This chapter explores advanced deployment scenarios for RH-SSO (Keycloak 7.6.x), focusing on clustering, resilience, and the architectural challenges of multi-site deployments.
Note: This content reflects legacy architectures. For modern, cloud-native HA, please refer to the RHBK Multi-Site SSO Workshop.
- Domain Mode
- High Availability (HA) Mode with External Infinispan and Shared PostgreSQL Database
- High Availability (HA) Mode with External Infinispan and Multi-Master MariaDB/Galera Cluste
- Addressing Cross-Site Configuration Challenges
Discussing the risks of operating two separate clusters in Active-Active mode without synchronous replication.
Understanding the requirements for a single, centralized relational database (PostgreSQL) shared by all cluster nodes to maintain data consistency.
- Domain Controller (Master Node)
- Host Instances
- Configuration Files
- Network configuration
- Database configuration
- RHSSO(Keycloak) setup
- The Cross-site challenge in domain mode
An overview of database-level replication options (e.g., Galera) required to support a multi-site RH-SSO deployment.
- Build the HAProxy Image
- Run the HAProxy Container
- Export Realm Configuration
- Import Realm Configuration
- Prerequisites
- Relations in deployment
- Sites configurations
- Network configuration
- Cache configuration
- Docker compose file
- Storage
- Run the cluster containers