What is Keycloak used for?

What is Keycloak used for? : Keycloak is an open source Identity and Access Management solution targeted towards modern applications and services . Keycloak offers features such as Single-Sign-On (SSO) , Identity Brokering and Social Login, User Federation, Client Adapters, an Admin Console, and an Account Management Console.

Read Detail Answer On What is Keycloak used for?

Application security is a subject that is getting more and more attention every day. Millions of dollars in fines and other costs could result from unauthorized access to protected data. The management of user identities and access is a requirement for almost every application.

Many free and paid products that claim to offer these features are available on the market. As you can probably guess from the title of this article, I’ll try to introduce you to one of these tools in this one, which is Keycloak.

I hope that this article will give you a better understating of its basics and why it may be profitable for you to get more familiar with it. As usual, I will start with a short description of what Keycloak exactly is.

Before we start — a quick disclaimer

This article will be only about Keycloak Server. Tools like Keycloak Gatekeeper or Adapters will not be mentioned here. Everytime I use the word “Keycloak” it means Keycloak Server.

According to their GitHub project page, it is a tool for identity and access management. Keycloak is a free software program that is currently distributed under the Apache License version 2. 0. If you’re looking for something more enterprise-focused, you can check it out because it’s also an upstream project for Red Hat SSO.

The full list of supported platforms depends on which protocol you decide to use, currently Keycloak supports three different protocols, and can be viewed in documentation. Keycloak’s initial release took place in September 2014; the current version is 15.0.2 (2021-10-09). It is developed and maintained by people from RedHat. They are open to new contributors if anyone is interested.

Keycloak Features

After the brief introduction from the previous paragraph, I think it is time to tell you more about what Keycloak can do.

  • Multiple Protocols Support

    As for now Keycloak supports three different protocols, namely – OpenID Connect, OAuth 2.0 and SAML 2.0.

  • SSO

    Keycloak has full support for Single Sign-On and Single Sign-Out.

  • Admin Console

    Keycloak offersweb-based GUI where you can “click out” all configurations required by your instance to work as you desire.

  • User Identity and Accesses

    Keycloak can be used as a standalone user identity and access manager by allowing us to create users database with custom roles and groups. This information can be further used to authenticate users within our application and secure parts of it based on pre-defined roles.

  • External Identity Source Sync

    In case when your clientcurrently has some type of user database, Keycloak allows us to synchronize with such database. By default, it supports LDAP and Active Directory but you can create custom extensions for any user database using Keycloak User storage API. Keep in mind that such a solution may not have all data necessary for Keycloak to be fully functional, so remember to check if your desired functionality works.

  • Identity Brokering

    Keycloak can also work as a proxy between your users and some externalidentity provider or providers. Their list can be edited from Keycloak Admin Panel.

  • Social Identity Providers

    Additionally, Keycloak allows us to use Social Identity Providers. It has built-in support Google, Twitter, Facebook, Stack Overflow but, in the end, you have to configure all of them manually from admin panel. The full list of supported social identity providers and their configuration manual can be found in Keycloak documentation.

  • Pages Customization

    Keycloaklets you customize all pages displayed by it to your users. Those pages are in .ftl format so you can use classic HTML  markups and CSS styles to make the page fit your  application style and your company brand. You can even put custom JS scripts as part of pages customization so possibilities are limitless.

READ More:  Phantom Breaker: Battle Grounds - Kemomimi Costume DLC On Steam Free Download Full Version

These are all of Keycloak features which I wanted to describe today. Of course, this tool offers even more possibilities, which are described in amuch more detailed way in the documentation. 

Distributions of Keycloak

Currently, Keycloak has three major distributions.

  • Server

    Standalone application is downloadable from Keycloak page in form of a tar or zip archive with all scripts, docs, and assets needed to work normally. As for now, there are two main versions of this distribution: one is powered by WildFly server while the other is powered by Quarkus. It is now in preview stage so some unexpectederror may occur.

  • Docker Image

    Distribution appropriate for Docker, Podman, Kubernetes, and OpenShift. There are two official docker images for Keycloak: one is held in Quay Container Registry – quay.io/keycloak/keycloak, the second one is held in Docker Hub – jboss/keycloak. You can download both of them with a simple docker pull command.

  • Operator

    Distribution for Kubernetes and OpenShift based on Operator SDK.

Everyone can locate a suitable distribution, as you can see. You have access to the Keycloak image and operator if you use Docker or Kubernetes. On the other hand, you can also find a distribution if you favor a more traditional deployment style. Keycloak Docker image can still be very helpful for development and testing even in that case.

You can set up your test Keycloak server then do changes and test them. After tests you can restart your Docker image and all changes made to your Keycloak will be reverted and you will get a clear environment for furthertests. All three distributions can be downloaded from here.

Keycloak Integrations

You now understand the fundamentals of Keycloak and its features. How to incorporate it into your app is the last thing left to discuss.

Here I will speak mostly from the perspective of Java eco-system but I will mention also some other languages and frameworks. In Java currently the most popular frameworks likeSpring Boot, Quarkus and Micronaut have some sort of adapters that make integrating with Keycloak really easy.

In case of Spring Boot, it is spring-boot-keycloak-starter while in case of Quarkus it is quarks-keycloak-authorization.

On the otherhand, in Python package python-keycloak seems pretty useful. 

For Scala-based application library, keycloak4s also sounds good. 

For C# based application Keycloak.Net lookslike a handy lib. 

All libraries are open source, developed and maintained by the community built around Keycloak. I will put respective links in the end of the article.

In the case of Spring Boot and Quarkus, thanks to the framework provided abstractions, the whole integration requires just a few lines of code and filling some configuration properties. In other cases, libraries only provide clients for Keycloak API so integration could be more complex.

Why You ShouldKnow Keycloak

It is free, to start. You might find it amusing, but most tools with these features, like AuthO or Okta, are paid for.

Secondly, it supports three different authentication protocols which give you the possibility to cover many applications with different security demands with a single tool.

You are not restricted by the tool you are using and can choose an authentication protocol based on your needs or what you believe will work best for your application. You can be sure that Keycloak is a well-written and well-designed system because it is also an upstream project for Red Hat SSO.

Additionally, it has a sizable community, which ensures that there are numerous examples of how to do something and that you can rely on others to assist you with your problems. When your client already has a user database, such as LDAP or Active Directory, Keycloak can be very helpful because it has a built-in mechanism for synchronization with these identity providers.

READ More:  Protonwar On Steam Free Download Full Version

Keycloak may be very helpful for you and your team if you want to use Social Login because it supports social identity providers like Google or Facebook out of the box.

Furthermore, it provides web-based GUI which makes any configurations changes easier. In the end, thanks to Keycloak SSO support you can facilitate your users’ access to multiple services run by your company.

When It May Not Bethe Best Choice

I said why you should use Keycloak so, to stay objective, I will say something about when it may not be the best choice for you.

  • Single application with just one client in Keycloak realm – lose all benefits of SSO

  • No integration with AD or any other user data provider

  • No Social Login

  • Pure user database — Keycloak can be used this way but so can a database with specific tables, and it can be much easier to configureif you already have one

  • Some kind of enterprise-level guarantees — Keycloak is still an open-source project so you do not have any guarantee provided by its producer about its working or road map and things likes customer support are taken care of by Stack Overflow and surely with no hard deadlines for response time

Keep in mind that meeting any or even all of these conditions by your application does not straight away indicate that you should not be usingKeycloak. It only means that it may be profitable for you to reconsider pros and cons of securing your application with Keycloak. Perhaps there is a less complex tool or solution that can be used.

Summing up

I presented some basic information about what Keycloak is, which features it provides, and added few words about its different distributions. I concluded with a short explanation when it may be the better choice than others tools and when it may not. I hope that my article gaveyou some more general knowledge about Keycloak itself, what it offers and when it may help you. The final decision about diving deeper into Keycloak I leave to you.


  • What is Keycloak?Keycloak is a tool for Identity and Access Management.
  • Is Keycloak free?Yes, as for now Keycloak is open-source and has Apache License 2.0.
  • Which security protocols are supported by Keycloak?As for now Keycloaksupports OpenID Connect, OAuth 2.0 and SAML 2.0.
  • Does Keycloak support SSO?Yes, Keycloak support both Single Sign-On and Single Sign-Out.
  • What are current Keycloak distributions?As for now, Keycloak has 3 different distributions: Server, Docker image and Operator.
  • How can I integrate Keycloak?Keycloak provides API and client library which you can use in your application. Additionally, there are severalimplementations of this library in many different languages.
  • Is there a tool like Keycloak with enterprise support?Keycloak is an upstream project for Red-hat SSO so I recommend checking it.
  • Keycloak Application security Open source Docker (software) Spring Framework Authentication protocol Distribution (differential geometry) KubernetesDatabase

    Opinions expressed by DZone contributors are their own.

    Is Keycloak a LDAP? : A built-in LDAP/AD provider is included with Keycloak. In the same Keycloak realm, it is possible to federate various LDAP servers. In the Keycloak common user model, you can map LDAP user attributes. It maps username, email, first name, and last name by default, but you are free to configure additional mappings.
    What is Keycloak and Oauth? : OAuth2 and OpenID Connect(OIDC) protocol compliant, Keycloak is an open source identity and access management server. This article will describe how to use the Spring OAuth2 library to secure Spring Boot REST APIs with Keycloak. Three methods for securing Spring-based REST APIs are recommended by Keycloak documentation.
    Is Keycloak a server? : You control Keycloak on your network as a separate server. Applications are set up to access this server and are protected by it. Open protocol standards, such as OpenID Connect or SAML 2, are used by Keycloak. For your applications’ security, use 0.

    READ More:  Atelier Ayesha: The Alchemist of Dusk DX On Steam Free Download Full Version

    Additional Question — What is Keycloak used for?

    When should I use Keycloak?

    Because it has a built-in mechanism for synchronization with such identity providers, Keycloak can be very helpful when your client has an existing user database like LDAP or Active Directory.

    Does Keycloak use JWT?

    This demonstrates how to generate JWT token using Keycloak. This can be used to authenticate the API user as well as to enable OAuth 2.0 authorization for all OAuth protected APIs using OpenID Connect in the Storefront application. This can be used as an alternative to the Auth microservice.

    How do I run a Keycloak server?

    To do first this open the Keycloak admin console (localhost:8180/admin or http:// :8080/admin) and login with the admin credentials: Username: admin. Password: admin. Start by creating a user role:
    Select Roles from the menu.
    Click Add Role.
    Enter user as Role Name.
    Click Save.

    What database does Keycloak use?

    Keycloak comes with its own embedded Java-based relational database called H2. This is the default database that Keycloak will use to persist data and really only exists so that you can run the authentication server out of the box.

    How do I run a Keycloak as a service?

    The server download ZIP file contains the scripts and binaries to run the Keycloak server.
    Download keycloak-11.0. [zip|tar.
    Place the file in a directory you choose.
    Unpack the ZIP file using the appropriate unzip utility, such as jar, tar, or unzip. $ unzip keycloak-11.0.3.zip or $ tar -xvzf keycloak-11.0.3.tar.gz.

    What is Keycloak in Kubernetes?

    With little to no coding required, modern applications and services can be secured with Keycloak, an open-source identity and access management tool. Keycloak capabilities, common protocols.

    How do I run a Keycloak on Kubernetes?

    There are a few more things you should do before running Keycloak in production, such as: Before you begin. Launch Keycloak. With the Ingress addon active, access Keycloak. Activate the admin console. Make a world. Build a user. Log in to the account console. Secure your first app. Next.

    How do I set up a Keycloak?

    Create a realm (or use one that already exists) and configure the Keycloak server. Establish a client. The client represents an instance of the EBICS Client application For the client, specify one or more roles. Groups, which are logical groupings or sets of permissions, are an optional option that you have. Recruit Users. Give the users their roles.

    How do you integrate Keycloaks with Kubernetes?

    Find out more about installing Kubernetes and Helm on various cloud services. Launch Keycloak on Kubernetes as the first step. Second step: Establish a Keycloak realm and user. Developing a Keycloak client is step three. Step 4: Integrate Keycloak with an Express application. Step 5: Verify the Keycloak integration.

    Where do I deploy a Keycloak?

    By developing deployment, service, and ingress yaml files for Keycloak, we can install it on a Kubernetes cluster. For keycloak to be deployed on Kubernetes, a deployment yaml file needs to be created. Keycloak DeploymentDeployment using the distribution file for Keycloak. using Docker to deploy. Kubernetes-based deployment

    How do you integrate an app with a Keycloak?

    Add keycloak and spring-boot dependencies to integrate multiple applications. CreateSecurityConfig Produce software. Run docker-compose up from the command prompt to launch Keycloak. Launch your browser and type the keycloak url. ‘admin’ is the default username and password. Select Add Realm.

    Dannie Jarrod

    Leave a Comment