Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • Guided learning
      Receive custom learning paths powered by our AI assistant.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

Keycloak: Core concepts of open source identity and access management

December 11, 2019
Abhishek Koserwal
Related topics:
Security
Related products:
Red Hat Single sign-on

    Keycloak provides the flexibility to export and import configurations easily, using a single view to manage everything. Together, these technologies let you integrate front-end, mobile, and monolithic applications into a microservice architecture. In this article, we discuss the core concepts and features of Keycloak and its application integration mechanisms. You will find links to implementation details near the end.

    Core concepts

    Let's start with Keycloak's core concepts, as shown in Figure 1:

    Keycloak core concepts

    Figure 1: Keycloak's core concepts.">

    A Keycloak realm is like a namespace that allows you to manage all of your metadata and configurations. You can have multiple realms based on your requirements. Generally, it is recommended to avoid using the master realm, which is for administration purposes only.

    In Figure 1, you can see the information that Keycloak lets you manage, namely:

    • Clients (per application)
    • Configuration management
    • Custom themes (UI)
    • Events
    • Federation
    • LDAP or Active Directory integration
    • User management (users and groups)

    Note: You can have one client that contains configuration information for a single application, such as the URL, protocol, and redirect URI.

    Figure 2 shows how Keycloak gives you access to all of this information in a single view:

    Keycloak's UI offers access to many settings.
    Keycloak's UI offers access to many settings.

    Figure 2: Keycloak's UI offers access to many settings.">

    Why should you use Keycloak?

    Let's take a look at why you might choose Keycloak, aside from the sheer amount of management you can accomplish within a single view.

    Keycloak is reliable

    Keycloak is a reliable solution, designed following standard security protocols to provide a dynamic single sign-on solution. Red Hat runs on Red Hat products, which includes single sign-on (SSO), and Red Hat trusts the upstream product Keycloak for their downstream product Red Hat SSO. Red Hat SSO handles Red Hat's entire authentication and authorization system. Additionally, Keycloak is licensed under Apache License Version 2.0 and has a strong and active open source community.

    Keycloak supports standard protocols

    Keycloak supports the following standard protocols:

    • OAuth 2.0
    • OpenID Connect
    • SAML 2.0

    This support means that any tool or application that supports integration with the above protocols can be plugged into with Keycloak (for example, enterprise applications like Red Hat Ansible Tower or SAP Business Intelligence Platform).

    Keycloak is ready for production

    As mentioned earlier, Keycloak is already being used in production. Before doing so yourself, make sure to go through the production-readiness documentation.

    Launching Keycloak

    To launch Keycloak with Docker, use:

    $ docker pull jboss/keycloak
    $ docker run -d -e KEYCLOAK_USER=<USERNAME> -e KEYCLOAK_PASSWORD=<PASSWORD> -p 8081:8080 jboss/keycloak

    However, your configuration information (like realm settings, clients, or certificates) will be temporary in this scenario. Therefore, export the configuration and re-import every time before you instantiate a new container. In other words, use a persistent volume for storing the state.

    To do a standalone Keycloak launch (https://www.keycloak.org/downloads.html) with JBoss WildFly, use:

    $ keycloak-x.x.x.Final/bin>./standalone.sh

    Preparing to integrate with Keycloak

    Once you're ready to integrate your apps, tools, and services with Keycloak, you have decisions to make (see Figure 3):

    Keycloak integration relationship map.

    Figure 3: Keycloak integration map.">

    First, you need to decide which protocol you intend to use, such as:

    • OAuth2
    • OpenID Connect
    • Security Assertion Markup Language (SAML).

    Are you looking for authentication or authorization?

    OAuth 2 != Authentication, only Authorization 
    
    OpenID Connect = Identity + Authentication + Authorization

    Now, regarding the application:

    • Is it running on a container (stateless) or is it in a legacy clustered (shared state) environment?
    • What does the architecture consist of, such as single-page applications (SPA), microservices, serverless, or MVC?
    • Identify the resources and endpoints you want to secure. Is your integration between, for example, client and server, service-to-service, or API endpoints.
    • Identify which adapter will be suited for your architecture.

    Integrating with Keycloak

    To integrate your apps with Keycloak:

    1. Create a realm. You can use master for a dev environment or base it on your business domain (for example, external-appsor internal-apps).
    2. Create a client for your application (for example, hello-world-app). Client configuration requires details like this:
      • Protocol: Which protocol, such as SAML or OpenID.
      • Resource Endpoint: The application hostname or REST endpoint.
      • Redirect URI: Where to redirect the user when authentication is granted.
    3. Provide the client configuration to your application as input, such as:
      • The clientId (i.e.,hello-world-app)
      • The realm (i.e.,external-apps)
      • The Keycloak server's URL.

    That’s all you need to do in order to configure your application with Keycloak.

    Wrapping up

    In conclusion, you can refer to the following integration patterns when you work with Keycloak yourself:

    • Vue
    • Angular
    • React
    • Spring-boot 2
    • Quarkus and React

    References

    • Keycloak Documentation
    • Securing Applications and Services Guide

    Happy secure coding!

    Last updated: February 11, 2024

    Recent Posts

    • SQL Server HA on RHEL: Meet Pacemaker HA Agent v2 (tech preview)

    • Deploy with confidence: Continuous integration and continuous delivery for agentic AI

    • Every layer counts: Defense in depth for AI agents with Red Hat AI

    • Fun in the RUN instruction: Why container builds with distroless images can surprise you

    • Trusted software factory: Building trust in the agentic AI era

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Chat Support

    Please log in with your Red Hat account to access chat support.