Keycloak
Keycloak Overview
Section titled “Keycloak Overview”What is Keycloak
Section titled “What is Keycloak”- Keycloak is an open-source identity and access management solution targeting modern applications and services. It makes it easy to secure applications and services with little to no code.
- Keycloak’s default authentication method is OIDC based on OAuth 2.0
- It is a solution optimized for Kubernetes and MSA environments.
Keycloak Core Concepts
Section titled “Keycloak Core Concepts”- Keycloak Core Concepts

Keycloak Advantages
Section titled “Keycloak Advantages”- Provided as open source, and the community version can be used without additional cost
Keycloak Features
Section titled “Keycloak Features”- User Registration
- Social login
- Single Sign-On/Sign-Off across all applications
- belonging to the same Realm
- 2-factor authentication
- LDAP integration
- Kerberos broker
- multitenancy with per-realm customizable skin
Keycloak Terminology
Section titled “Keycloak Terminology”- Realm
- A unit representing the scope in which authentication and authorization operate. Taking SSO (Single Sign-On) as an example, if certain clients share SSO, that scope is limited to the Realm that those clients commonly belong to. By default, a Realm called Master, which cannot be deleted, is provided.
- Client
- A unit representing an application that delegates authentication and authorization actions to JBoss Keycloak. It can be a website or a service that provides a REST API. One Realm can create and manage n Clients that belong to it.
- User
- A unit representing the actual user who will log in to each Client. One Realm can create and manage n Users that belong to it. By default, a User entity can have 4 items: Username, Email, First Name, and Last Name, and you can freely add custom items through the Custom User Attributes feature.
- OIDC (OpenID Connect)
- Based on the OAuth 2.0 protocol, it handles authentication simply at a higher layer and can provide user information in a more secure way through an identity verification service (IDP).
Keycloak Hands-on
Section titled “Keycloak Hands-on”- Install Keycloak, Grafana
- Add a realm and client to Keycloak
- Configure Keycloak
- Redeploy after integration configuration
- Verify Keycloak + Grafana integration
Keycloak with k8s Apps
Section titled “Keycloak with k8s Apps”- Keycloak with k8s Apps

Install Keycloak, Grafana
Section titled “Install Keycloak, Grafana”- Clone the Keycloak, Grafana installation and integration shell file and yaml file to your local PC
- The repository is private due to the AWS settings in the yaml files
- A separate request is needed to be invited as a team member to that repository
git clone https://github.com/Salteed/dp2_keycloak- Run 01_install.sh
- Enter the following information
- Namespace to install Keycloak in
- Keycloak administrator account
- Keycloak administrator password
- Namespace to install Grafana in
- Verify the Keycloak and Grafana endpoints
- Enter the following information
sh 01_install.shAdd a realm and client to Keycloak
Section titled “Add a realm and client to Keycloak”- Run 02_keycloak_setting.sh
- Enter the following information
- Name of the realm to add to Keycloak
- Client ID to add to the realm
- Enter the following information
sh 02_keycloak_setting.shConfigure Keycloak
Section titled “Configure Keycloak”- After connecting to Keycloak, click Administration Console
- Log in with the Keycloak administrator account
- Click the Clients menu on the left -> click the Client ID
- Change Access Type from public -> confidential and save
- Click the Credentials tab and copy the Secret key
- Click the Users menu on the left and click Add user
- Enter Username and Email and save
- Click the Credentials tab, enter the Password, and click Set Password
- Click the Clients menu on the left and click the Client ID
- Click the Roles tab and click Add Role
- Enter the Role Name and save
- Click the Roles menu on the left and click default-roles-{realm name}
- ex) default-roles-realm-50
- Click Client Roles and select the client you created
- ex) client-50
- Click the created Role and click Add selected
Redeploy after integration configuration
Section titled “Redeploy after integration configuration”- Modify the keycloak secret value in the 04_connect_authorization.sh file
- ex) i_keycloak_secret
- Check the script
- Run 04_connect_authorization.sh
sh 04_connect_authorization.shVerify Keycloak + Grafana integration
Section titled “Verify Keycloak + Grafana integration”- Connect to Grafana
- Click Sign in with Login Keycloak
- Enter Username and Password
- Verify the login