Skip to content
Menu
DevSecOps Now!!!
  • About
  • Certifications
  • Contact
  • Courses
  • DevSecOps Consulting
  • DevSecOps Tools
  • Training
  • Tutorials
DevSecOps Now!!!

What is a Client Role in Keycloak?

Posted on October 8, 2025

Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now

In Keycloak, clients represent applications or services (like APIs, admin dashboards, or web apps) that want to use Keycloak for authentication and authorization.

Each client can have its own set of roles, called Client Roles.
These roles define permissions or capabilities specific to that application.


Difference Between Realm Roles and Client Roles

TypeScopeAssigned ToUsed For
Realm RoleGlobal (applies to the entire realm)Users, groupsGeneral permissions across all clients
Client RoleLocal to a specific clientUsers, groups, or other clientsPermissions specific to one client (application)

Think of realm roles as company-wide positions, and client roles as department-specific roles.


How Client Roles Work

Each client can define its own roles in Keycloak โ†’ Clients โ†’ [Your Client] โ†’ Roles.
When a user logs in, Keycloak issues a token (like an ID token or access token) that includes those client roles, which the client app can then use for authorization checks.

For example:

  • realm: mycompany
  • client: dashboard-app
  • client role: admin, editor, viewer

When ashwani@example.com logs in:

  • If heโ€™s assigned admin for dashboard-app, the JWT token will contain: "resource_access": { "dashboard-app": { "roles": ["admin"] } }

Common Client Roles and Their Purpose

Below is a list of commonly used client roles (you may find them in different contexts depending on the applicationโ€™s purpose):

1. admin

  • Purpose: Full control over the client application.
  • Usage Example: Can manage users, settings, configurations.
  • Used In: Admin panels, CMS dashboards, API management portals.

2. manager

  • Purpose: Manage sections or subsets of resources.
  • Usage Example: Can approve/reject user requests, manage teams but not system-wide settings.
  • Used In: Organization-level apps or project managers in SaaS dashboards.

3. user

  • Purpose: Basic role for authenticated users.
  • Usage Example: Default role given upon signup or login.
  • Used In: End-user portals, customer dashboards, employee login systems.

4. viewer / read-only

  • Purpose: Can view data but cannot modify anything.
  • Usage Example: Monitoring dashboards, analytics viewers.
  • Used In: Business intelligence tools, reports section.

5. editor

  • Purpose: Can modify or create resources but cannot manage system settings.
  • Usage Example: Content creators, blog managers, or task updaters.
  • Used In: CMS or internal apps for content editing.

6. auditor

  • Purpose: View logs, reports, and audit trails for compliance.
  • Usage Example: Security or compliance officers.
  • Used In: Financial systems, SRE dashboards, logging tools.

7. service-account

  • Purpose: Used by other services (not human users) to access APIs with specific privileges.
  • Usage Example: API-to-API communication.
  • Used In: Microservice architectures, automation scripts.

8. api-client

  • Purpose: Restricts access to API endpoints.
  • Usage Example: Users or systems that consume REST/GraphQL APIs.
  • Used In: Public APIs, mobile backend APIs.

9. developer

  • Purpose: Can deploy, test, and debug client-specific features.
  • Usage Example: Developers managing staging or dev environments.
  • Used In: Dev portals, staging tools, developer sandboxes.

10. super-admin

  • Purpose: Has access to all clients within the realm.
  • Usage Example: Platform-level administrators.
  • Used In: SaaS multi-tenant admin dashboards, platform management UIs.

11. guest

  • Purpose: Temporary or limited access user.
  • Usage Example: Trial users, temporary link-based access.
  • Used In: Freemium applications, shared links.

12. support

  • Purpose: Helpdesk or support role with limited administrative rights.
  • Usage Example: Can view and fix user issues but not change configurations.
  • Used In: Customer support consoles.

13. billing-admin

  • Purpose: Access to billing and subscription management features.
  • Usage Example: Can view or modify payment methods and invoices.
  • Used In: SaaS apps with subscription tiers.

Assigning Client Roles

Client roles can be assigned:

  1. Directly to a user
  2. To a group (users inherit the roles)
  3. Through a composite realm role
  4. Or even to another clientโ€™s service account

You can view this under:

Users โ†’ [username] โ†’ Role Mappings โ†’ Client Roles โ†’ [select client]

Example Token Structure with Client Roles

{
  "realm_access": {
    "roles": ["offline_access", "uma_authorization"]
  },
  "resource_access": {
    "account": {
      "roles": ["manage-account", "view-profile"]
    },
    "dashboard-app": {
      "roles": ["admin", "editor"]
    },
    "api-gateway": {
      "roles": ["api-client"]
    }
  }
}

Best Practices for Client Roles

Best PracticeExplanation
Keep roles minimalDonโ€™t overload clients with too many rolesโ€”group them logically.
Use groups for scalabilityAssign roles to groups instead of each user individually.
Use consistent namingExample: appname_admin, appname_user, etc.
Avoid mixing concernsDonโ€™t use realm roles for app-specific logic. Keep them separate.
Use mappers carefullyConfigure Client Role mappers to ensure tokens include the correct roles.

Summary

ConceptDescription
Client RolesDefine permissions specific to one client (app).
Where UsedLogin flows, token authorization, backend role checks.
Examplesadmin, user, viewer, editor, api-client, support, billing-admin.
BenefitFine-grained control over who can do what per client.

Post Views: 1,015
  • Client Role
  • Client Role in Keycloak
  • Client Roles
  • Difference Between Realm Roles and Client Roles
  • How Client Roles Work
  • Keycloak
  • Realm Roles
  • What is a Client Role
  • What is a Client Role in Keycloak?
Subscribe
Login
Notify of
guest
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
  • Linux Server Diagnostic Commands: Complete Guide for Performance, Network & System Troubleshooting
  • The Ultimate Guide to CDOM โ€“ Certified DataOps Manager Certification
  • The Practical Path to AI Reliability: A Guide to the Certified MLOps Manager
  • Master the Machine Learning Lifecycle:Guide to Becoming a Certified MLOps Architect
  • How to Build a Project-Level AI Memory System That Works Across Codex, Claude, and Other AI Coding Tools
  • Certified MLOps Professional: A Deep Dive into the Certified MLOps Professional Certification
  • Certified MLOps Engineer : The Comprehensive Guide to Mastering Machine Learning Operations
  • Codex vs Claude: A Complete Practical Guide for Modern Developers (2026)
  • Certified AIOps Professional Program A Guide to Career Growth
  • Keycloak Multi-Client Architecture with Project-Based Email Validation (Student, Trainer, Company, Consulting)
  • Incorrect definition of table mysql.column_stats
  • Mautic and PHP 8.3 Compatibility Guide (2026)
  • Certified AIOps Engineer: The Complete Career Path and Certification Guide
  • How to Rename Apache Virtual Host Files Safely (Step-by-Step Guide for Linux)
  • AIOps Foundation Certification: Everything You Need to Know to Get Certified
  • DevOps to Certified Site Reliability Professional: A Senior Mentorโ€™s Guide
  • Certified Site Reliability Manager Training, Preparation, and Career Mapping
  • Certified Site Reliability Architect: The Complete Career Guide
  • What Is a VPN? A Complete Beginner-to-Advanced Tutorial
  • How to Install, Secure, and Tune MySQL 8.4 on Ubuntu 24.04 for Apache Event MPM and PHP-FPM
  • Complete Guide to Certified Site Reliability Engineer Career
  • Certified DevSecOps Professional Step by Step
  • Certified DevSecOps Manager: Complete Career Guide
  • Certified DevSecOps Engineer: Skills, Career Path and Certification Guide
  • Step-by-Step: Become a Certified DevSecOps Architect
  • Tuning PHP 8.3 for Apache Event MPM and PHP-FPM on Ubuntu: A Complete Step-by-Step Production Guide
  • Complete Step-by-Step Guide to Configure Apache Event MPM, Create index.php, Set Up VirtualHost, and Fix Ubuntu Default Page
  • Convert XAMPP Apache to Event MPM + System PHP-FPM
  • The Gateway to System Observability Engineering (MOE)
  • How to Finetune Apache and Prove It Works: A Real-World Guide to Testing Performance, Concurrency, HTTP/2, Memory, CPU, and Security

Recent Comments

  1. emmy day on SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘provider’ in ‘field list’
  2. digital banking on Complete Tutorial: Setting Up Laravel Telescope Correctly (Windows + XAMPP + Custom Domain)
  3. SAHIL DHINGRA on How to Uninstall Xampp from your machine when it is not visible in Control panel programs & Feature ?
  4. Abhishek on MySQL: List of Comprehensive List of approach to secure MySQL servers.
  5. Kristina on Best practices to followed in .httacess to avoid DDOS attack?

Archives

  • April 2026
  • March 2026
  • February 2026
  • January 2026
  • December 2025
  • November 2025
  • October 2025
  • September 2025
  • August 2025
  • July 2025
  • June 2025
  • May 2025
  • April 2025
  • March 2025
  • February 2025
  • January 2025
  • December 2024
  • November 2024
  • October 2024
  • September 2024
  • August 2024
  • July 2024
  • June 2024
  • May 2024
  • April 2024
  • March 2024
  • February 2024
  • January 2024
  • December 2023
  • November 2023
  • October 2023
  • September 2023
  • August 2023
  • July 2023
  • May 2023
  • April 2023
  • March 2023
  • February 2023
  • January 2023
  • December 2022

Categories

  • Ai
  • AI Blogging
  • AiOps
  • ajax
  • Android Studio
  • Antimalware
  • Antivirus
  • Apache
  • Api
  • API Security
  • Api Testing
  • APK
  • Aws
  • Bike Rental Services
  • ChatGPT
  • Code Linting
  • Composer
  • cPanel
  • Cyber Threat Intelligence
  • Cybersecurity
  • Data Loss Prevention
  • Database
  • dataops
  • Deception Technology
  • DeepSeek
  • Devops
  • DevSecOps
  • DevTools
  • Digital Asset Management
  • Digital Certificates
  • Docker
  • Drupal
  • emulator
  • Encryption Tools
  • Endpoint Security Tools
  • Error
  • facebook
  • Firewalls
  • Flutter
  • git
  • GITHUB
  • Google Antigravity
  • Google play console
  • Google reCAPTCHA
  • Gradle
  • Guest posting
  • health and fitness
  • IDE
  • Identity and Access Management
  • Incident Response
  • Instagram
  • Intrusion Detection and Prevention Systems
  • jobs
  • Joomla
  • Keycloak
  • Laravel
  • Law News
  • Lawyer Discussion
  • Legal Advice
  • Linkedin
  • Linkedin Api
  • Linux
  • Livewire
  • Mautic
  • Medical Tourism
  • MlOps
  • MobaXterm
  • Mobile Device Management
  • Multi-Factor Authentication
  • MySql
  • Network Traffic Analysis tools
  • Paytm
  • Penetration Testing
  • php
  • PHPMyAdmin
  • Pinterest Api
  • Quora
  • SAST
  • SecOps
  • Secure File Transfer Protocol
  • Security Analytics Tools
  • Security Auditing Tools
  • Security Information and Event Management
  • Seo
  • Server Management Tools
  • Single Sign-On
  • Site Reliability Engineering
  • soft 404
  • software
  • SuiteCRM
  • SysOps
  • Threat Model
  • Twitter
  • Twitter Api
  • ubuntu
  • Uncategorized
  • Virtual Host
  • Virtual Private Networks
  • VPNs
  • Vulnerability Assessment Tools
  • Web Application Firewalls
  • Windows Processor
  • Wordpress
  • WSL (Windows Subsystem for Linux)
  • X.com
  • Xampp
  • Youtube
©2026 DevSecOps Now!!! | WordPress Theme: EcoCoded
wpDiscuz