Rollen und Berechtigungen

Roles

In Keycloak dient eine Rolle als eine Art Label, das wir einem Benutzer oder einer Gruppe von Benutzern zuweisen können, um bestimmte Berechtigungen zu vergeben. Ein Benutzer mit einer bestimmten Rolle kann daraufhin bestimmte Aktionen ausführen oder auf bestimmte Ressourcen zugreifen, je nachdem, wie client-Anwendungen diese Rollen interpretieren.

Realm-Rollen vs. Client-Rollen

Realm-Rollen: Diese Rollen sind auf Realm-Ebene definiert und gelten für den gesamten Realm. Das heißt, wenn Sie eine Realm-Rolle zu einem Benutzer hinzufügen, hat der Benutzer diese Rolle in jeder Anwendung innerhalb dieses Realms. Realm-Rollen sind ideal für Berechtigungen, die über viele Services hinweg gelten sollen. Diese Rollen sind oft allgemeine Rollen, wie z.B. admin, user oder manager.

Client-Rollen: Diese Rollen sind spezifisch für einen bestimmten Client innerhalb eines Realms. Sie würden Client-Rollen verwenden, wenn Sie einer Anwendung spezifische Rollen hinzufügen möchten. Diese Rollen sind nützlich, um Berechtigungen auf Anwendungsebene feiner zu steuern.

Composite-Rollen: Keycloak erlaubt es auch, sogenannte Composite-Rollen zu erstellen. Ein Composite ist im Grunde eine Rolle, die eine Sammlung von anderen Rollen enthält. Dabei ist es möglich, sowohl Realm-Rollen als auch Client-Rollen in einer einzigen Composite-Rolle zu bündeln. Der Hauptvorteil davon ist, dass Sie eine Reihe von Berechtigungen gruppieren können, die zusammen einen bestimmten Zweck oder Kontext erfüllen.

Werbung/Advertising

<

Microsoft Windows Server 2022

Microsoft Windows Server 2022

Preis: 349,90 EUR

Zum Angebot

Adobe Acrobat Standard 2020 OEM

Adobe Acrobat Standard 2020 OEM

Preis: 900,00 EUR

Zum Angebot

Office 2016 Professional

Office 2016 Professional

Preis: 14,90 EUR

Zum Angebot

Adobe Photoshop Elements 2025

Adobe Photoshop Elements 2025

Preis: 190,00 EUR

Zum Angebot

Microsoft Excel 2019

Microsoft Excel 2019

Preis: 14,90 EUR

Zum Angebot

Panda Dome Advanced MD

Panda Dome Advanced MD

Preis: 15,00 EUR

Zum Angebot

Microsoft Word 2016

Microsoft Word 2016

Preis: 14,90 EUR

Zum Angebot

Kaspersky Mobile

Kaspersky Mobile

Preis: 25,00 EUR

Zum Angebot

AVG Internet Security

AVG Internet Security

Preis: 25,00 EUR

Zum Angebot

Windows Server 2022 CALS

Windows Server 2022 CALS

Preis: 99,90 EUR

Zum Angebot

Office 2021 Home and Business

Office 2021 Home and Business

Preis: 24,90 EUR

Zum Angebot

Windows 10 Pro

Windows 10 Pro

Preis: 14,90 EUR

Zum Angebot

McAfee Internet Security

McAfee Internet Security

Preis: 25,00 EUR

Zum Angebot

Visio 2019 Professional

Visio 2019 Professional

Preis: 14,90 EUR

Zum Angebot

Office 2019 Professional Plus

Office 2019 Professional Plus

Preis: 14,90 EUR

Zum Angebot

Office 2024 Home

Office 2024 Home

Preis: 44,90 EUR

Zum Angebot

Pinnacle Studio 26 (2023) STANDARD Windows / Deutsch

Pinnacle Studio 26 (2023) STANDARD Windows / Deutsch

Preis: 110,00 EUR

Zum Angebot

Office 2016 Home and Student

Office 2016 Home and Student

Preis: 14,90 EUR

Zum Angebot

Microsoft Excel 2021

Microsoft Excel 2021

Preis: 19,90 EUR

Zum Angebot

Microsoft Word 2021

Microsoft Word 2021

Preis: 14,90 EUR

Zum Angebot

Windows Server 2016

Windows Server 2016

Preis: 99,90 EUR

Zum Angebot

Windows 10/11 Home

Windows 10/11 Home

Preis: 14,90 EUR

Zum Angebot

Office 2021 Home and Student

Office 2021 Home and Student

Preis: 19,90 EUR

Zum Angebot

Norton 360 Deluxe inkl. 25GB MD

Norton 360 Deluxe inkl. 25GB MD

Preis: 25,00 EUR

Zum Angebot

McAfee VPN Safe Connect

McAfee VPN Safe Connect

Preis: 30,00 EUR

Zum Angebot

Windows 11 Home

Windows 11 Home

Preis: 19,90 EUR

Zum Angebot

Windows Server 2022 RDS CALS

Windows Server 2022 RDS CALS

Preis: 109,90 EUR

Zum Angebot

Bitdefender Antivirus Plus

Bitdefender Antivirus Plus

Preis: 50,00 EUR

Zum Angebot

Office 2019 Professional

Office 2019 Professional

Preis: 39,90 EUR

Zum Angebot

Windows 10/11 Pro

Windows 10/11 Pro

Preis: 19,90 EUR

Zum Angebot

Windows Server 2016 RDS CALS

Windows Server 2016 RDS CALS

Preis: 64,90 EUR

Zum Angebot

AVG Ultimate

AVG Ultimate

Preis: 25,00 EUR

Zum Angebot

Office 2024 Professional

Office 2024 Professional

Preis: 39,90 EUR

Zum Angebot

Office 2021 Professional Plus + Windows 11 Professional Bundle

Office 2021 Professional Plus + Windows 11 Professional Bundle

Preis: 24,90 EUR

Zum Angebot

Office 2019 Home and Business

Office 2019 Home and Business

Preis: 19,90 EUR

Zum Angebot

Avast Premium Security

Avast Premium Security

Preis: 20,00 EUR

Zum Angebot

Office 2016 Home and Business

Office 2016 Home and Business

Preis: 14,90 EUR

Zum Angebot

Office 2021 Professional Plus + Windows 11 Professional GRATIS

Office 2021 Professional Plus + Windows 11 Professional GRATIS

Preis: 24,90 EUR

Zum Angebot

Office 2021 Professional

Office 2021 Professional

Preis: 19,90 EUR

Zum Angebot

Windows Server 2019 RDS CALS

Windows Server 2019 RDS CALS

Preis: 93,90 EUR

Zum Angebot

Trend Micro Antivirus + Security

Trend Micro Antivirus + Security

Preis: 20,00 EUR

Zum Angebot

Windows 10 Home

Windows 10 Home

Preis: 14,90 EUR

Zum Angebot

Office 2019 Home and Student

Office 2019 Home and Student

Preis: 19,90 EUR

Zum Angebot

Office 2024 Professional Plus

Office 2024 Professional Plus

Preis: 29,99 EUR

Zum Angebot

Windows Server 2019 CALS

Windows Server 2019 CALS

Preis: 87,90 EUR

Zum Angebot

Watchdog Anti-Malware Vollversion

Watchdog Anti-Malware Vollversion

Preis: 25,00 EUR

Zum Angebot

Windows Server Standard 2022

Windows Server Standard 2022

Preis: 194,90 EUR

Zum Angebot

Visio 2016 Professional

Visio 2016 Professional

Preis: 14,90 EUR

Zum Angebot

ESET NOD32 Antivirus

ESET NOD32 Antivirus

Preis: 50,00 EUR

Zum Angebot

Windows Server 2016 CALS

Windows Server 2016 CALS

Preis: 64,90 EUR

Zum Angebot

Microsoft Word 2019

Microsoft Word 2019

Preis: 14,90 EUR

Zum Angebot

Microsoft Office 2021 Standard

Microsoft Office 2021 Standard

Preis: 24,90 EUR

Zum Angebot

Microsoft Powerpoint 2019

Microsoft Powerpoint 2019

Preis: 29,90 EUR

Zum Angebot

Office 2019 Professional plus

Office 2019 Professional plus

Preis: 39,90 EUR

Zum Angebot

Bitdefender Premium VPN

Bitdefender Premium VPN

Preis: 90,00 EUR

Zum Angebot

Microsoft Windows Server 2022 Datacenter

Microsoft Windows Server 2022 Datacenter

Preis: 219,00 EUR

Zum Angebot

Office 2021 Professional Plus f?r 3 Ger?te

Office 2021 Professional Plus f?r 3 Ger?te

Preis: 23,50 EUR

Zum Angebot

McAfee Total Protection

McAfee Total Protection

Preis: 15,00 EUR

Zum Angebot

AVG TuneUp ESD

AVG TuneUp ESD

Preis: 25,00 EUR

Zum Angebot

Office 2021 Professional Plus

Office 2021 Professional Plus

Preis: 19,90 EUR

Zum Angebot

Panda Dome Essential MD

Panda Dome Essential MD

Preis: 15,00 EUR

Zum Angebot

Microsoft Office 2019 Standard

Microsoft Office 2019 Standard

Preis: 19,90 EUR

Zum Angebot

Windows 11 Pro

Windows 11 Pro

Preis: 14,90 EUR

Zum Angebot

CorelCAD 2021 Upgrade Windows/Mac ESD

CorelCAD 2021 Upgrade Windows/Mac ESD

Preis: 180,00 EUR

Zum Angebot

mySteganos Online Shield VPN

mySteganos Online Shield VPN

Preis: 55,00 EUR

Zum Angebot

Panda Dome Complete MD

Panda Dome Complete MD

Preis: 25,00 EUR

Zum Angebot
>

Realm Roles anlegen

  • Im Realm olymp
    • Ream roles → Create role
      • admin
    • Ream roles → Create role
      • user

Create Realm Role

Create Realm Role

Client Roles anlegen

  • Clients → athen → Tab Roles → Create role
    • client_admin
  • Clients → athen → Tab Roles → Create role
    • client_user
Create Client Role

Create Client Role

Werbung/Advertising

Aromatico

Composite-Roles anlegen

  • Realm roles → admin → Associated roles → Action → Add associated Roles → Filter by clients
    • Auswählen
      (athen) client_admin
      (athen) client_user

      • Assign
1. Add associated roles
Create Composite Role - Part 1

Create Composite Role – Part 1

2. Filter by clients
Create Composite Role - Part 2

Create Composite Role – Part 2

3. Assign roles to admin
Create Composite Role - Part 3

Create Composite Role – Part 3

Werbung/Advertising

Aromatico

Eine weitere Composite-Role

  • Realm roles → user → Associated roles → Action → Add associated Roles → Filter by clients
    • Auswählen
      (athen) client_user

      • Assign

Die Wirkung der Zuordnung einer zusammengesetzten Rolle

Das Zuweisen einer zusammengesetzten Rolle wie ‚admin‘ zu einem Benutzer hat den Vorteil, dass dieser Benutzer nun alle Berechtigungen erbt, die mit den einzelnen Rollen verbunden sind, aus denen die zusammengesetzte Rolle besteht. Im Fall von ‚zeus‘ bedeutet dies:

  • Durch die Realm-Rolle ‚admin‘ erhält der Benutzer administrative Privilegien auf der Ebene des Realms.
  • Mit der Client-Rolle ‚Role client_admin‘ bekommt ‚zeus‘ administrative Rechte für den Client ‚athen‘.
  • Die Client-Rolle ‚Role client_user‘ gewährt ‚zeus‘ zusätzliche benutzerspezifische Rechte für denselben Client.

Das macht die Verwaltung von Berechtigungen viel effizienter und übersichtlicher. Statt mehrere einzelne Rollen zu verwalten, können Sie einfach eine zusammengesetzte Rolle erstellen und diese einem Benutzer zuweisen. Die zusammengesetzte Rolle dient quasi als eine Art „Rechte-Bündel“, das einfach verteilt und verwaltet werden kann.

Nun wissen wir, wie Realms, User und Rollen angelegt werden und wie man eine oder mehrere Rollen einem User zuordnet. Jetzt ist ein guter Zeitpunkt, um das einmal auszuprobieren:

  • Erstellen Sie einen User hercules im Realm olymp
  • Erstellen Sie ein Passwort für den User hercules
  • Weisen Sie dem neuen User die Realm- (composite) Role user zu

Sie können natürlich beliebig andere User hinzufügen. In den hier gezeigten Beispielen ist der Einfachheit halber der Username immer identisch mit dem Passwort.

Ausblick

Demnächst steht die Konfiguration des Realms olymp sowie eine Spring-Demo-Anwendung zum Authorization-Code-Flow auf GitHub zur Verfügung.

Werbung/Advertising

<

Windows Server 2016 RDS CALS

Windows Server 2016 RDS CALS

Preis: 64,90 EUR

Zum Angebot

McAfee VPN Safe Connect

McAfee VPN Safe Connect

Preis: 30,00 EUR

Zum Angebot

Windows Server 2022 RDS CALS

Windows Server 2022 RDS CALS

Preis: 109,90 EUR

Zum Angebot

Office 2016 Professional

Office 2016 Professional

Preis: 14,90 EUR

Zum Angebot

Windows Server Standard 2022

Windows Server Standard 2022

Preis: 194,90 EUR

Zum Angebot

Kaspersky Mobile

Kaspersky Mobile

Preis: 25,00 EUR

Zum Angebot

Windows 11 Home

Windows 11 Home

Preis: 19,90 EUR

Zum Angebot

Windows 10 Pro

Windows 10 Pro

Preis: 14,90 EUR

Zum Angebot

Avast Premium Security

Avast Premium Security

Preis: 20,00 EUR

Zum Angebot

Panda Dome Essential MD

Panda Dome Essential MD

Preis: 15,00 EUR

Zum Angebot

Panda Dome Advanced MD

Panda Dome Advanced MD

Preis: 15,00 EUR

Zum Angebot

Windows 11 Pro

Windows 11 Pro

Preis: 14,90 EUR

Zum Angebot

Office 2021 Professional

Office 2021 Professional

Preis: 19,90 EUR

Zum Angebot

ESET NOD32 Antivirus

ESET NOD32 Antivirus

Preis: 50,00 EUR

Zum Angebot

Panda Dome Complete MD

Panda Dome Complete MD

Preis: 25,00 EUR

Zum Angebot

Office 2021 Professional Plus + Windows 11 Professional GRATIS

Office 2021 Professional Plus + Windows 11 Professional GRATIS

Preis: 24,90 EUR

Zum Angebot

Microsoft Windows Server 2022 Datacenter

Microsoft Windows Server 2022 Datacenter

Preis: 219,00 EUR

Zum Angebot

Office 2019 Professional plus

Office 2019 Professional plus

Preis: 39,90 EUR

Zum Angebot

Office 2019 Professional

Office 2019 Professional

Preis: 39,90 EUR

Zum Angebot

Office 2021 Home and Business

Office 2021 Home and Business

Preis: 24,90 EUR

Zum Angebot

Microsoft Office 2021 Standard

Microsoft Office 2021 Standard

Preis: 24,90 EUR

Zum Angebot

Microsoft Windows Server 2022

Microsoft Windows Server 2022

Preis: 349,90 EUR

Zum Angebot

Norton 360 Deluxe inkl. 25GB MD

Norton 360 Deluxe inkl. 25GB MD

Preis: 25,00 EUR

Zum Angebot

Windows Server 2016

Windows Server 2016

Preis: 99,90 EUR

Zum Angebot

McAfee Total Protection

McAfee Total Protection

Preis: 15,00 EUR

Zum Angebot

Adobe Photoshop Elements 2025

Adobe Photoshop Elements 2025

Preis: 190,00 EUR

Zum Angebot

Office 2019 Professional Plus

Office 2019 Professional Plus

Preis: 14,90 EUR

Zum Angebot

AVG Internet Security

AVG Internet Security

Preis: 25,00 EUR

Zum Angebot

Office 2024 Professional

Office 2024 Professional

Preis: 39,90 EUR

Zum Angebot

Windows 10/11 Pro

Windows 10/11 Pro

Preis: 19,90 EUR

Zum Angebot

mySteganos Online Shield VPN

mySteganos Online Shield VPN

Preis: 55,00 EUR

Zum Angebot

Trend Micro Antivirus + Security

Trend Micro Antivirus + Security

Preis: 20,00 EUR

Zum Angebot

Microsoft Word 2016

Microsoft Word 2016

Preis: 14,90 EUR

Zum Angebot

Office 2019 Home and Business

Office 2019 Home and Business

Preis: 19,90 EUR

Zum Angebot

Windows Server 2022 CALS

Windows Server 2022 CALS

Preis: 99,90 EUR

Zum Angebot

Bitdefender Antivirus Plus

Bitdefender Antivirus Plus

Preis: 50,00 EUR

Zum Angebot

Windows Server 2019 RDS CALS

Windows Server 2019 RDS CALS

Preis: 93,90 EUR

Zum Angebot

Office 2024 Home

Office 2024 Home

Preis: 44,90 EUR

Zum Angebot

Pinnacle Studio 26 (2023) STANDARD Windows / Deutsch

Pinnacle Studio 26 (2023) STANDARD Windows / Deutsch

Preis: 110,00 EUR

Zum Angebot

Adobe Acrobat Standard 2020 OEM

Adobe Acrobat Standard 2020 OEM

Preis: 900,00 EUR

Zum Angebot

Microsoft Powerpoint 2019

Microsoft Powerpoint 2019

Preis: 29,90 EUR

Zum Angebot

Office 2021 Home and Student

Office 2021 Home and Student

Preis: 19,90 EUR

Zum Angebot

Office 2016 Home and Business

Office 2016 Home and Business

Preis: 14,90 EUR

Zum Angebot

AVG Ultimate

AVG Ultimate

Preis: 25,00 EUR

Zum Angebot

AVG TuneUp ESD

AVG TuneUp ESD

Preis: 25,00 EUR

Zum Angebot

Visio 2016 Professional

Visio 2016 Professional

Preis: 14,90 EUR

Zum Angebot

CorelCAD 2021 Upgrade Windows/Mac ESD

CorelCAD 2021 Upgrade Windows/Mac ESD

Preis: 180,00 EUR

Zum Angebot

Office 2021 Professional Plus + Windows 11 Professional Bundle

Office 2021 Professional Plus + Windows 11 Professional Bundle

Preis: 24,90 EUR

Zum Angebot

Microsoft Word 2021

Microsoft Word 2021

Preis: 14,90 EUR

Zum Angebot

Watchdog Anti-Malware Vollversion

Watchdog Anti-Malware Vollversion

Preis: 25,00 EUR

Zum Angebot

Windows Server 2019 CALS

Windows Server 2019 CALS

Preis: 87,90 EUR

Zum Angebot

Office 2016 Home and Student

Office 2016 Home and Student

Preis: 14,90 EUR

Zum Angebot

Microsoft Office 2019 Standard

Microsoft Office 2019 Standard

Preis: 19,90 EUR

Zum Angebot

Microsoft Excel 2021

Microsoft Excel 2021

Preis: 19,90 EUR

Zum Angebot

Office 2019 Home and Student

Office 2019 Home and Student

Preis: 19,90 EUR

Zum Angebot

Microsoft Word 2019

Microsoft Word 2019

Preis: 14,90 EUR

Zum Angebot

McAfee Internet Security

McAfee Internet Security

Preis: 25,00 EUR

Zum Angebot

Office 2021 Professional Plus

Office 2021 Professional Plus

Preis: 19,90 EUR

Zum Angebot

Office 2024 Professional Plus

Office 2024 Professional Plus

Preis: 29,99 EUR

Zum Angebot

Windows 10/11 Home

Windows 10/11 Home

Preis: 14,90 EUR

Zum Angebot

Windows Server 2016 CALS

Windows Server 2016 CALS

Preis: 64,90 EUR

Zum Angebot

Office 2021 Professional Plus f?r 3 Ger?te

Office 2021 Professional Plus f?r 3 Ger?te

Preis: 23,50 EUR

Zum Angebot

Windows 10 Home

Windows 10 Home

Preis: 14,90 EUR

Zum Angebot

Microsoft Excel 2019

Microsoft Excel 2019

Preis: 14,90 EUR

Zum Angebot

Visio 2019 Professional

Visio 2019 Professional

Preis: 14,90 EUR

Zum Angebot

Bitdefender Premium VPN

Bitdefender Premium VPN

Preis: 90,00 EUR

Zum Angebot
>