#31 - Keycloak Admin CLI | Add Role To User

Опубликовано: 21 Июль 2026
на канале: Ahmet Arabacı Tech
53
6

👋 Ahmet Arabacı Tech kanalına hoş geldiniz !

Spring Security ve Keycloak serimizin 31. bölümünde otomasyon seviyemizi artırıyoruz. Web konsolu üzerinden manuel işlem yapmak yerine, Spring Boot ve Keycloak Admin Client kullanarak kod üzerinden kullanıcılara rol ataması yapıyoruz.

Bu videoda, Keycloak'a bağlanan, belirli bir kullanıcıyı bulan ve ona bir "Client Role" atayan bir servisi nasıl yazacağımızı öğreneceksiniz. Bu işlem, dinamik kayıt ve yetkilendirme sistemleri kurmak için olmazsa olmazdır.

🚀 Bu videoda neler öğreneceksiniz ?

👋 Giriş: Admin Client yeteneklerine genel bakış.

⚙️ Keycloak Admin Client: Spring Boot içerisinde Keycloak nesnesinin kullanımı.

🔍 Kullanıcı ve Rol Getirme: Kod ile doğru Kullanıcı ID'sini ve Rolü bulma yöntemleri.

🛠️ Kullanıcıya Rol Ekleme: RealmResource ve UserResource kullanarak rol atama (mapping) işlemi.

🧪 Test: Yapılan atamanın Postman veya Konsol üzerinden doğrulanması.

İçeriği faydalı bulduysanız videoyu Beğenmeyi ve yazılım serilerimizin devamı için Abone Olmayı unutmayın! 💻

👋 Welcome to the Ahmet Arabacı Tech channel !

In the 31st episode of our Spring Security & Keycloak series, we are taking automation to the next level. Instead of manually using the web console, we are using Spring Boot and the Keycloak Admin Client to assign roles programmatically.

In this tutorial, we will write a service that connects to Keycloak, retrieves a specific user, and assigns them a Client Role via code. This is essential for building dynamic registration and permission systems.

🚀 In this video, we will cover:

👋 Welcome & Intro: A brief overview of the Admin Client capabilities.

⚙️ Keycloak Admin Client: How to use the Keycloak instance in Spring Boot.

🔍 Fetch User & Role: How to find the correct User ID and Role representation programmatically.

🛠️ Add Role to User: The specific commands to map a role to a user resource.

🧪 Testing: Verifying the role assignment via Postman or the Console.

If you find this content helpful, please Like the video and Subscribe to support the channel! 💻

#Keycloak #SpringBoot #SpringSecurity #Java #KeycloakAdminClient #RoleManagement #SoftwareDevelopment #YazılımGeliştirme #AhmetArabacıTech #Coding #Backend #API