Keycloak - an Open Source Identity and Access Management tool

Overview

keycloak-meetup

We aim to explain how we have used keycloak open source identity management platform for providing Single Sign On feature for our customers.

Keycloak is an Open Source Identity and Access Management tool. You can use it to add authentication to applications and secure services with minimum effort. No need to deal with storing users or authenticating users.

Keycloak provides user federation, strong authentication, user management, fine-grained authorization, and more.

for details and new versions, please visit https://www.keycloak.org/

installing keycloak

for the sake of simplicity, we will use the development version of keycloak, you can simply download the keycloak from following address https://www.keycloak.org/downloads

we have used version 17.0.0.

importing realm : ldap-demo

Keycloak uses the concept of realms as kind of tenants. we should create a realm by importing from file provided in this repository

  • click Add realm button
  • select ldaprealm.json file
  • set realm name : ldap-demo
  • see schreen shot
  • click Create button

running LDAP service

in the scope of this demo, we will use LDAP as authentication manager and authorizing users / groups. therefore an LDAP server should be used. you can use any one of LDAP service

  • Apache DS
  • Redhat freeipa
  • Active Directory
  • etc.

for simplicity, we will start LDAP service from keycloak source code.

  • download keycloak source code from this url : https://github.com/keycloak/keycloak/archive/refs/tags/17.0.0.zip
  • extract the zip content
  • overwrite the ldap source file ldap-example-users.ldif from this repository to examples/ldap folder in keycloak source code. this modified file contains additional groups and group memberships
  • follow the instructions from the file README.md in folder examples/ldap to start the LDAP service
  • in short you should be able to run following command mvn exec:java -Pldap

test LDAP connection from keyclaok

once the LDAP service is running, go back to keycloak realm configuration page to test the connection

  • select realm ldap-demo if not already selected
  • click User Federation from the left action buttons
  • click ldap-apacheds to open details
  • click Test connection and Test authentication buttons to make sure that LDAP service can be connected without any issues.
  • if connected and authenticated successfully in previous step, click on Syncronize all users button. see imported users from ldap.
  • click Users from the left action buttons and view two users imported from LDAP.

import user groups from LDAP

in order to import user groups from LDAP, we need to define a mapper for user federation

  • click User Federation from the left action buttons
  • click ldap-apacheds to open details
  • open Mappers tab and click Create button
  • enter following values
    • Name : LDAP Group mapper
    • Mapper Type : group-ldap-mapper
    • LDAP Groups DN : ou=UserRoles,dc=keycloak,dc=org
    • Drop non-existing groups during sync : ON
  • click Save button and then click Synchronize LDAP groups to Keycloak button.
  • click Groups from the left action buttons and see that two groups are fetched from LDAP
    • normalUsers - having member : [jbrown]
    • superUsers - having member : [bwilson]

create client : demo-client

for authentication & authorization operations we will define a new client : demo-client.

  • click Clients from the left action buttons
  • click Create button and fill in the form
    • Client ID : demo-client
    • Client Protocol : openid-connect
  • cick Save button

in the Demo-client page, simply provide following values and save the changes. since this demo aims to keep things simple, we'll just use URIs including localhost:3000

authentication from Postman

a Postman collection file Keycloak Meetup.postman_collection.json is provided in this repository, go ahead and import this collection in your Postman. after importing the collection, try to run the two keyclaok authentication requests

  • v17.0 - Authenticate - bwilson - SUPER_USER
  • v17.0 - Authenticate - jbrown - NORMAL_USER

you should be able to get a successfull response from Keycloak with valid jwt token and refresh token

You might also like...

An Open-Source repository 🌎 that contains all the Data Structures and Algorithms concepts and their implementation, programming questions and Interview questions

An Open-Source repository 🌎 that contains all the Data Structures and Algorithms concepts and their implementation, programming questions and Interview questions

An Open-Source repository 🌎 that contains all the Data Structures and Algorithms concepts and their implementation, programming questions and Interview questions. The main aim of this repository is to help students who are learning Data Structures and Algorithms or preparing for an interview.

Dec 29, 2022

OBKV Table Client is Java Library that can be used to access table data from OceanBase storage layer.

OBKV Table Client OBKV Table Client is Java Library that can be used to access table data from OceanBase storage layer. Its access method is different

Dec 16, 2022

Simplifies the development of creating a JPA-based data access layer.

Spring Data JPA Spring Data JPA, part of the larger Spring Data family, makes it easy to easily implement JPA based repositories. This module deals wi

Jan 5, 2023

This project demonstrates usage of Captcha, OTP APIs to access Offline eKYC XML.

Client Application to simulate offline eKYC wrapper API flow Introduction This is a Spring boot application which can be used to download offline eKYC

Oct 29, 2021

A generic proxy server for applying access-control policies for a FHIR-store.

A generic proxy server for applying access-control policies for a FHIR-store.

FHIR Access Proxy This is a simple access-control proxy that sits in front of a FHIR store (e.g., a HAPI FHIR server, GCP FHIR store, etc.) and contro

Jan 5, 2023

Deploy this 🔥🔥🔥 BLAZING FAST 🔥🔥🔥 API to get instant access to ✨✨✨ INNOVATIVE ✨✨✨ API to quickly define whether the numbers are odd or even.

Deploy this 🔥🔥🔥 BLAZING FAST 🔥🔥🔥 API to get instant access to ✨✨✨ INNOVATIVE ✨✨✨ API to quickly define whether the numbers are odd or even.

Is Odd API This 👈 is 🅱 💰 a 🐍 simple API that 🍑 returns 💌 whether 📊 📊 a 🔥 number 💦 🔢 is 🙈 💦 odd 🤥 or 💰 not. ♂ With 👏 👼 this 🏽 👈 API

Sep 23, 2022

Hcode Online Judge(HOJ):An open source online judge system base on SpringBoot, Springcloud Alibaba and Vue.js !

Hcode Online Judge(HOJ):An open source online judge system base on SpringBoot, Springcloud Alibaba and Vue.js !

Hcode Online Judge(HOJ) 前言 基于前后端分离,分布式架构的在线测评平台(hoj),前端使用vue,后端主要使用springboot,redis,mysql,nacos等技术。 在线Demo:https://hdoi.cn 在线文档:https://www.hcode.top/

Dec 31, 2022

Free and 100% open source Progressive Java Runtime for modern Java™ deployments supported by a leading OpenJDK contributor

BellSoft Liberica JDK is a build of OpenJDK that is tested and verified to be compliant with the Java SE specification using OpenJDK Technology Compat

Dec 22, 2022

GreenMail is an open source, intuitive and easy-to-use test suite of email servers for testing purposes.

GreenMail GreenMail is an open source, intuitive and easy-to-use test suite of email servers for testing purposes. Supports SMTP, POP3, IMAP with SSL

Dec 28, 2022
Owner
Erdem Günay
Erdem Günay
Just-In-Time Access is an AppEngine application that lets you manage just-in-time privileged access to Google Cloud projects.

Just-In-Time Access Just-In-Time Access is an AppEngine application that lets you manage just-in-time privileged access to Google Cloud projects. Syno

Google Cloud Platform 36 Jan 3, 2023
An open source Minecraft plugin that allows operators to control who has access to the nether.

Nether Access Controller Description Nether Access Controller is a Minecraft plugin that allows operators to control access to the nether. It is essen

Daniel Stephenson 2 Feb 12, 2022
Demo microservice architecture with Spring ,Spring Cloud Gateway , Spring Cloud config server , Eureuka , keycloak and Docker.

spring-microservice Demo microservice architecture with Spring ,Spring Cloud Gateway , Spring Cloud config server , Eureuka , keycloak and Docker. Arc

null 4 Sep 13, 2022
An extension for Keycloak, that enables web-based sign in with Apple and token exchange

Apple Identity Provider for Keycloak ?? This repository represents an extension for Keycloak, which enables Sign in with Apple for web-based applicati

Klaus Betz 58 Dec 29, 2022
Keycloak Login Recaptcha

Keycloak Login Recaptcha Keycloak supports the recaptcha in the registration flow but not in the login flow at this time. That's why this repository i

null 7 Jun 4, 2022
Custom Keycloak.X Server Distribution with selective features

Custom Keycloak Server Simple example for creating a custom Quarkus based Keycloak Distribution with 0 known CVEs. Features Create a custom Quarkus ba

Thomas Darimont 18 Oct 19, 2022
Aye - an open source tool for scanning images on Kubernetes cluster

Aye is an open source tool for scanning images on Kubernetes cluster. It uses Anchore CLI behind the scenes to get information about all images that are currently on the cluster. It also provides Prometheus metrics for each image, so teams are aware of different levels of vulnerabilities found inside them.

null 4 Sep 4, 2022
Apollo is a reliable configuration management system suitable for microservice configuration management scenarios.

English | 中文 Apollo - A reliable configuration management system Apollo is a reliable configuration management system. It can centrally manage the con

Apollo 27.6k Jan 5, 2023
A manager tool to categorize game assets such as images and sounds/music. The tool enables you to tag these files, so that finding them by tags allows fast searches.

BtAssetManager This application allows you to easily categorize large amounts of image and sound files. You can apply tags to each individual file to

null 21 Sep 15, 2022
An API Library that provides the functionality to access, manage and store device topologies found in JSON files using Java and Maven Framework

Topology API ?? About An API library which provides the functionality to access, manage and store device topologies. ?? Description Read a topology fr

Abdelrahman Hamdy 2 Aug 4, 2022