Authorization code flow Intro

Authorization Code Flow

Herzlich willkommen in der Welt der sicheren Authentifizierung! In einer Zeit, in der die Online-Sicherheit eine immer größere Rolle spielt, präsentiere ich  Ihnen heute eine Lösung: den Authorization Code Flow mit Keycloak. Stellen Sie sich vor, Sie könnten die Sicherheitsstandards Ihrer Anwendung deutlich anheben, ohne sich in komplexe Kodierungsprozesse vertiefen zu müssen. Genau das ermöglicht unsere neueste Spring Boot Keycloak-Demo-Anwendung, die ich unter GitHub – zeus-keycloak-demo bereitstelle. Tauchen Sie in die faszinierende Welt der Authentifizierungsflüsse ein und entdecken Sie, wie der OAuth 2.0 Authorization Code Flow Ihren Nutzern nicht nur Sicherheit, sondern auch Komfort bietet

Die unter GitHub – zeus-keycloak-demo vorliegende Spring Boot Keycloak-Demo-Anwendung authorization-code-flow demonstriert die Implementierung des Standard-Authentifizierungsflusses von Keycloak, der auf dem OAuth 2.0 Authorization Code Flow basiert. Voraussetzung ist eine installierte und laufende Keycloak-Instanz, wie im Workshop beschrieben. Sollte das Thema komplett neu für Sie sein, starten Sie am Besten hier: Einstieg in Keycloak

Dieser Flow ist speziell dafür konzipiert, Client-Anwendungen einen sicheren delegierten Zugriff auf Serverressourcen im Auftrag des Endnutzers zu ermöglichen. Durch die Verwendung von Authentifizierungscodes statt direkter Übertragung von Benutzerdaten, bietet dieser Flow einen erhöhten Schutz gegenüber Angriffen wie Cross-Site Request Forgery (CSRF).

Das Prinzip ist einfach, aber effektiv: Ein Nutzer wird aufgefordert, sich bei Keycloak zu authentifizieren. Nach erfolgreicher Authentifizierung wird ein einmaliger Authentifizierungscode generiert und an die Client-Anwendung zurückgesandt. Dieser Code kann dann gegen ein Access-Token, ein Refresh-Token und ein ID-Token eingetauscht werden. Mit dem Access-Token kann die Anwendung im Namen des Nutzers auf geschützte Ressourcen zugreifen. Das Refresh-Token wird verwendet, um das Access-Token zu erneuern, ohne dass der Nutzer sich erneut authentifizieren muss. Das ID-Token, ein JWT (JSON Web Token), enthält Identitätsinformationen über den Nutzer und wird häufig zur Authentifizierung und zur Sitzungsvalidierung in der Anwendung verwendet. So kann die Anwendung nicht nur auf Ressourcen zugreifen, sondern erhält auch bestätigte Informationen über die Identität des Nutzers.

Authorization Code Flow: Eine Spring Boot Demo-Application – https://localhost:8081

Authorization Code Flow Demo Application

Werbung/Advertising

<

Fujitsu Esprimo P757 E85+ Intel Quad Core i5 512GB SSD 16GB Windows 10 Home DVD Brenner

Fujitsu Esprimo P757 E85+ Intel Quad Core i5 512GB SSD 16GB Windows 10 Home DVD Brenner

Preis: 249,00 EUR

Zum Angebot

Apple iPhone SE (2022) 64GB Dual-SIM Mitternacht MMXF3ZD/A

Apple iPhone SE (2022) 64GB Dual-SIM Mitternacht MMXF3ZD/A

Preis: 279,00 EUR

Zum Angebot

Eizo FlexScan EV2436W-BK schwarz 24 Zoll WUXGA 1920x1200 DisplayPort DVI Höhenverstellbar

Eizo FlexScan EV2436W-BK schwarz 24 Zoll WUXGA 1920x1200 DisplayPort DVI Höhenverstellbar

Preis: 129,00 EUR

Zum Angebot
🔥 Bestseller

Lenovo ThinkVision T24d-10 schwarz 24 Zoll WUXGA 1920x1200 HDMI DisplayPort VGA Höhenverstellbar

Lenovo ThinkVision T24d-10 schwarz 24 Zoll WUXGA 1920x1200 HDMI DisplayPort VGA Höhenverstellbar

Preis: 159,00 EUR

Zum Angebot
🔥 Bestseller

Dell P2419HC schwarz 23,8 Zoll Full HD 1920x1080 DisplayPort HDMI USB Höhenverstellbar

Dell P2419HC schwarz 23,8 Zoll Full HD 1920x1080 DisplayPort HDMI USB Höhenverstellbar

Preis: 149,00 EUR

Zum Angebot
🔥 Bestseller

HP EliteBook 840 G8 14 Zoll 1920x1080 Full HD Intel Core i5 256GB SSD 16GB Windows 10 Pro - Neugerät

HP EliteBook 840 G8 14 Zoll 1920x1080 Full HD Intel Core i5 256GB SSD 16GB Windows 10 Pro - Neugerät

Preis: 668,00 EUR

Zum Angebot
🔥 Bestseller

Lenovo ThinkPad X1 Yoga Gen 7 14 Zoll Touch Display Intel Core i5 256GB SSD 32GB Windows 11 Pro LTE

Lenovo ThinkPad X1 Yoga Gen 7 14 Zoll Touch Display Intel Core i5 256GB SSD 32GB Windows 11 Pro LTE

Preis: 859,00 EUR

Zum Angebot
🔥 Bestseller

HP ZBook 15 G6 15,6 Zoll 1920x1080 Full HD Intel Core i7 512GB SSD 32GB Windows 11 Pro Nvidia Quadro

HP ZBook 15 G6 15,6 Zoll 1920x1080 Full HD Intel Core i7 512GB SSD 32GB Windows 11 Pro Nvidia Quadro

Preis: 779,00 EUR

Zum Angebot
🔥 Bestseller

Lenovo ThinkVision T24v-10 schwarz 23,8 Zoll Full HD 1920x1080 HDMI DisplayPort VGA Höhenverstellbar 61BCMAR6EU

Lenovo ThinkVision T24v-10 schwarz 23,8 Zoll Full HD 1920x1080 HDMI DisplayPort VGA Höhenverstellbar 61BCMAR6EU

Preis: 149,00 EUR

Zum Angebot

Apple iPad Air 3 (2019) 10,5 Zoll 256GB Wi-Fi + Cellular Space Grau

Apple iPad Air 3 (2019) 10,5 Zoll 256GB Wi-Fi + Cellular Space Grau

Preis: 329,00 EUR

Zum Angebot
🔥 Bestseller

Lenovo ThinkCentre neo 50q Gen 4 Intel Core i5-13420H 256GB SSD 16GB Windows 11 Pro inkl. W-Lan - Neugerät

Lenovo ThinkCentre neo 50q Gen 4 Intel Core i5-13420H 256GB SSD 16GB Windows 11 Pro inkl. W-Lan - Neugerät

Preis: 659,00 EUR

Zum Angebot
🔥 Bestseller

Lenovo ThinkCentre neo 50q Gen 4 Intel Core i5-13420H 256GB SSD 8GB Windows 11 Pro inkl. W-Lan - Neugerät

Lenovo ThinkCentre neo 50q Gen 4 Intel Core i5-13420H 256GB SSD 8GB Windows 11 Pro inkl. W-Lan - Neugerät

Preis: 639,00 EUR

Zum Angebot
🔥 Bestseller

Lenovo ThinkVision T24v-10 schwarz 23,8 Zoll Full HD 1920x1080 HDMI DisplayPort VGA Höhenverstellbar 61BCMAR6

Lenovo ThinkVision T24v-10 schwarz 23,8 Zoll Full HD 1920x1080 HDMI DisplayPort VGA Höhenverstellbar 61BCMAR6

Preis: 169,00 EUR

Zum Angebot
🔥 Bestseller

Lenovo ThinkStation P520c Intel Xeon W-2133 512GB SSD 32GB Windows 10 Pro Nvidia Quadro P4000

Lenovo ThinkStation P520c Intel Xeon W-2133 512GB SSD 32GB Windows 10 Pro Nvidia Quadro P4000

Preis: 699,00 EUR

Zum Angebot

Fujitsu Esprimo D956 E85+ Desktop Intel Quad Core i5 256GB SSD 8GB Windows 10 Home

Fujitsu Esprimo D956 E85+ Desktop Intel Quad Core i5 256GB SSD 8GB Windows 10 Home

Preis: 219,00 EUR

Zum Angebot

Eizo FlexScan EV2456-BK schwarz 24 Zoll WUXGA 1920x1200 DisplayPort HDMI DVI-D VGA USB Höhenverstellbar

Eizo FlexScan EV2456-BK schwarz 24 Zoll WUXGA 1920x1200 DisplayPort HDMI DVI-D VGA USB Höhenverstellbar

Preis: 199,00 EUR

Zum Angebot

Apple iPhone X Smartphone Handy 5,8 Zoll 256GB Speicher Space Grau

Apple iPhone X Smartphone Handy 5,8 Zoll 256GB Speicher Space Grau

Preis: 339,00 EUR

Zum Angebot
🔥 Bestseller

HP ZBook Fury 15 G7 15,6 Zoll 1920x1080 Full HD Intel Core i7 512GB SSD 32GB Windows 11 Pro Nvidia Quadro

HP ZBook Fury 15 G7 15,6 Zoll 1920x1080 Full HD Intel Core i7 512GB SSD 32GB Windows 11 Pro Nvidia Quadro

Preis: 699,00 EUR

Zum Angebot
🔥 Bestseller

Lenovo ThinkPad P14s Gen 2 14 Zoll 1920x1080 Full HD Intel Core i5 512GB SSD 16GB Windows 11 Pro Fingerprint

Lenovo ThinkPad P14s Gen 2 14 Zoll 1920x1080 Full HD Intel Core i5 512GB SSD 16GB Windows 11 Pro Fingerprint

Preis: 729,00 EUR

Zum Angebot

Fujitsu Esprimo P5010n Intel Core i5-10400 256GB SSD 16GB Windows 11 Pro

Fujitsu Esprimo P5010n Intel Core i5-10400 256GB SSD 16GB Windows 11 Pro

Preis: 419,00 EUR

Zum Angebot
🔥 Bestseller

Lenovo ThinkCentre M70q Gen 5 Tiny Intel Core i5 256GB SSD 8GB Windows 11 Pro inkl. W-Lan - Neugerät

Lenovo ThinkCentre M70q Gen 5 Tiny Intel Core i5 256GB SSD 8GB Windows 11 Pro inkl. W-Lan - Neugerät

Preis: 719,00 EUR

Zum Angebot

Fujitsu Esprimo D756 E85+ Intel Pentium G4400 256GB SSD 4GB Windows 10 Pro DVD Brenner

Fujitsu Esprimo D756 E85+ Intel Pentium G4400 256GB SSD 4GB Windows 10 Pro DVD Brenner

Preis: 219,00 EUR

Zum Angebot

Fujitsu Esprimo P757 E85+ Intel Quad Core i5 512GB SSD 16GB Windows 10 Pro DVD Brenner

Fujitsu Esprimo P757 E85+ Intel Quad Core i5 512GB SSD 16GB Windows 10 Pro DVD Brenner

Preis: 269,00 EUR

Zum Angebot
🔥 Bestseller

Lenovo ThinkPad L14 Gen 3 14 Zoll Touch Display AMD Ryzen 7 PRO 512GB SSD 16GB Windows 11 Pro Webcam

Lenovo ThinkPad L14 Gen 3 14 Zoll Touch Display AMD Ryzen 7 PRO 512GB SSD 16GB Windows 11 Pro Webcam

Preis: 709,00 EUR

Zum Angebot
🔥 Bestseller

Dell Optiplex 7060 Micro Intel Core i5-8500 256GB SSD 16GB Windows 11 Pro

Dell Optiplex 7060 Micro Intel Core i5-8500 256GB SSD 16GB Windows 11 Pro

Preis: 349,00 EUR

Zum Angebot
🔥 Bestseller

Lenovo ThinkCentre Tiny-in-One 24 Gen 4 schwarz 23,8 Zoll Full HD 1920x1080 DisplayPort inkl. Webcam

Lenovo ThinkCentre Tiny-in-One 24 Gen 4 schwarz 23,8 Zoll Full HD 1920x1080 DisplayPort inkl. Webcam

Preis: 188,00 EUR

Zum Angebot
🔥 Bestseller

Lenovo ThinkCentre Tiny-in-One 24 Gen 4 schwarz 23,8 Zoll Full HD 1920x1080 DisplayPort inkl. Webcam - Neugerät

Lenovo ThinkCentre Tiny-in-One 24 Gen 4 schwarz 23,8 Zoll Full HD 1920x1080 DisplayPort inkl. Webcam - Neugerät

Preis: 269,00 EUR

Zum Angebot

Fujitsu Celsius M740 Intel Xeon Quad Core E5 v4 512GB SSD 32GB Windows 10 Pro Nvidia Quadro

Fujitsu Celsius M740 Intel Xeon Quad Core E5 v4 512GB SSD 32GB Windows 10 Pro Nvidia Quadro

Preis: 719,00 EUR

Zum Angebot
🔥 Bestseller

Lenovo ThinkPad X1 Yoga Gen 7 14 Zoll Touch Display Intel Core i5 256GB SSD 32GB Windows 10 Pro LTE

Lenovo ThinkPad X1 Yoga Gen 7 14 Zoll Touch Display Intel Core i5 256GB SSD 32GB Windows 10 Pro LTE

Preis: 869,00 EUR

Zum Angebot

LG 24BK550Y-B 24 Zoll Full HD 1920x1080 VGA DVI DisplayPort HDMI Höhenverstellbar Schwarz

LG 24BK550Y-B 24 Zoll Full HD 1920x1080 VGA DVI DisplayPort HDMI Höhenverstellbar Schwarz

Preis: 129,00 EUR

Zum Angebot

Apple iPhone XR Smartphone Handy 6,1 Zoll 256GB Speicher Schwarz

Apple iPhone XR Smartphone Handy 6,1 Zoll 256GB Speicher Schwarz

Preis: 239,00 EUR

Zum Angebot

Microsoft 365 Business Standard Office - 1 Nutzer

Microsoft 365 Business Standard Office - 1 Nutzer

Preis: 129,00 EUR

Zum Angebot
🔥 Bestseller

Lenovo ThinkPad P15 Gen 1 15,6 Zoll Full HD Intel Core i7 512GB SSD 32GB Windows 10 Pro Nvidia Quadro T2000

Lenovo ThinkPad P15 Gen 1 15,6 Zoll Full HD Intel Core i7 512GB SSD 32GB Windows 10 Pro Nvidia Quadro T2000

Preis: 879,00 EUR

Zum Angebot

Apple iPad 6 Tablet 9,7 Zoll Retina Multi-Touch 32GB SSD Wi-Fi + Cellular Space Grau

Apple iPad 6 Tablet 9,7 Zoll Retina Multi-Touch 32GB SSD Wi-Fi + Cellular Space Grau

Preis: 199,00 EUR

Zum Angebot
🔥 Bestseller

Lenovo ThinkStation P520 Intel Xeon W-2135 1TB SSD 64GB Windows 11 Pro Nvidia Geforce RTX 2080

Lenovo ThinkStation P520 Intel Xeon W-2135 1TB SSD 64GB Windows 11 Pro Nvidia Geforce RTX 2080

Preis: 919,00 EUR

Zum Angebot

Apple iPhone XR Smartphone Handy 6,1 Zoll 64GB Speicher Schwarz

Apple iPhone XR Smartphone Handy 6,1 Zoll 64GB Speicher Schwarz

Preis: 189,00 EUR

Zum Angebot
🔥 Bestseller

Lenovo ThinkStation P720 2x Intel Xeon Gold 5122 1TB SSD 64GB Windows 11 Pro Nvidia Quadro P4000 inkl. W-Lan

Lenovo ThinkStation P720 2x Intel Xeon Gold 5122 1TB SSD 64GB Windows 11 Pro Nvidia Quadro P4000 inkl. W-Lan

Preis: 899,00 EUR

Zum Angebot
🔥 Bestseller

HP ZBook 15 G6 15,6 Zoll 1920x1080 Full HD Intel Core i7 512GB SSD 16GB Windows 10 Pro

HP ZBook 15 G6 15,6 Zoll 1920x1080 Full HD Intel Core i7 512GB SSD 16GB Windows 10 Pro

Preis: 848,00 EUR

Zum Angebot
🔥 Bestseller

HP EliteBook 840 G6 14 Zoll 3840x2160 4K UHD Intel Core i7 1TB SSD 16GB Windows 11 Pro Webcam

HP EliteBook 840 G6 14 Zoll 3840x2160 4K UHD Intel Core i7 1TB SSD 16GB Windows 11 Pro Webcam

Preis: 699,00 EUR

Zum Angebot

Fujitsu Display B22-8 WE Neo 22 Zoll HD+ 1680x1050 DisplayPort DVI-D VGA Höhenverstellbar NEU & OVP

Fujitsu Display B22-8 WE Neo 22 Zoll HD+ 1680x1050 DisplayPort DVI-D VGA Höhenverstellbar NEU & OVP

Preis: 139,00 EUR

Zum Angebot
🔥 Bestseller

Lenovo ThinkPad Thunderbolt 3 Dock 40AC Dockingstation inkl. 135 Watt Netzteil inkl. USB-C Kabel 40AC0135EU

Lenovo ThinkPad Thunderbolt 3 Dock 40AC Dockingstation inkl. 135 Watt Netzteil inkl. USB-C Kabel 40AC0135EU

Preis: 119,00 EUR

Zum Angebot

Philips V-Line 243V7QDSB 24 Zoll Full HD 1920x1080 IPS VGA DVI HDMI Schwarz NEU & OVP

Philips V-Line 243V7QDSB 24 Zoll Full HD 1920x1080 IPS VGA DVI HDMI Schwarz NEU & OVP

Preis: 139,00 EUR

Zum Angebot
🔥 Bestseller

Lenovo Thinkpad Thunderbolt 3 Dock 40AC Dockingstation inkl. 135 Watt Netzteil inkl. USB-C Kabel

Lenovo Thinkpad Thunderbolt 3 Dock 40AC Dockingstation inkl. 135 Watt Netzteil inkl. USB-C Kabel

Preis: 129,00 EUR

Zum Angebot
🔥 Bestseller

HP EliteBook 840 G7 14 Zoll 1920x1080 Full HD Intel Core i7 512GB SSD 32GB Windows 10 Pro LTE

HP EliteBook 840 G7 14 Zoll 1920x1080 Full HD Intel Core i7 512GB SSD 32GB Windows 10 Pro LTE

Preis: 758,00 EUR

Zum Angebot
🔥 Bestseller

HP EliteBook x360 830 G8 13,3 Zoll Touch Display Intel Core i5 256GB SSD 16GB Windows 10 Pro Webcam

HP EliteBook x360 830 G8 13,3 Zoll Touch Display Intel Core i5 256GB SSD 16GB Windows 10 Pro Webcam

Preis: 629,00 EUR

Zum Angebot

Fujitsu Esprimo D956 E85+ Desktop Intel Quad Core i5 256GB SSD 8GB Windows 10 Pro

Fujitsu Esprimo D956 E85+ Desktop Intel Quad Core i5 256GB SSD 8GB Windows 10 Pro

Preis: 269,00 EUR

Zum Angebot
🔥 Bestseller

Lenovo ThinkPad P53 15,6 Zoll 1920x1080 Full HD Intel Core i7 512GB SSD 32GB Windows 11 Pro Nvidia Quadro

Lenovo ThinkPad P53 15,6 Zoll 1920x1080 Full HD Intel Core i7 512GB SSD 32GB Windows 11 Pro Nvidia Quadro

Preis: 799,00 EUR

Zum Angebot

Apple iPad 7 Tablet 10,2 Zoll Retina Multi-Touch 128GB SSD Wi-Fi + Cellular Space Grau

Apple iPad 7 Tablet 10,2 Zoll Retina Multi-Touch 128GB SSD Wi-Fi + Cellular Space Grau

Preis: 259,00 EUR

Zum Angebot

Apple iPhone XR Smartphone Handy 6,1 Zoll 128GB Speicher Schwarz

Apple iPhone XR Smartphone Handy 6,1 Zoll 128GB Speicher Schwarz

Preis: 229,00 EUR

Zum Angebot

Apple iPhone X Smartphone Handy 5,8 Zoll 64GB Speicher Space Grau

Apple iPhone X Smartphone Handy 5,8 Zoll 64GB Speicher Space Grau

Preis: 229,00 EUR

Zum Angebot
🔥 Bestseller

Lenovo Thinkpad Thunderbolt 3 Dock 40AC Dockingstation inkl. 135 Watt Netzteil inkl. USB-C Kabel 40AC0135EU

Lenovo Thinkpad Thunderbolt 3 Dock 40AC Dockingstation inkl. 135 Watt Netzteil inkl. USB-C Kabel 40AC0135EU

Preis: 119,00 EUR

Zum Angebot
🔥 Bestseller

Lenovo ThinkPad P14s Gen 2 14 Zoll 1920x1080 Full HD Intel Core i5 512GB SSD 24GB Windows 11 Pro Nvidia Quadro

Lenovo ThinkPad P14s Gen 2 14 Zoll 1920x1080 Full HD Intel Core i5 512GB SSD 24GB Windows 11 Pro Nvidia Quadro

Preis: 719,00 EUR

Zum Angebot

Fujitsu Esprimo Q556 Intel Core i3 128GB SSD 4GB Windows 10 Home DVD Brenner

Fujitsu Esprimo Q556 Intel Core i3 128GB SSD 4GB Windows 10 Home DVD Brenner

Preis: 199,00 EUR

Zum Angebot
🔥 Bestseller

HP ZBook Fury 15 G8 15,6 Zoll 1920x1080 Full HD Intel Core i7 512GB SSD 32GB Windows 10 Pro Nvidia Quadro T1200

HP ZBook Fury 15 G8 15,6 Zoll 1920x1080 Full HD Intel Core i7 512GB SSD 32GB Windows 10 Pro Nvidia Quadro T1200

Preis: 759,00 EUR

Zum Angebot
🔥 Bestseller

Lenovo ThinkStation P520c Intel Xeon W-2133 512GB SSD 32GB Windows 11 Pro Nvidia Quadro P4000

Lenovo ThinkStation P520c Intel Xeon W-2133 512GB SSD 32GB Windows 11 Pro Nvidia Quadro P4000

Preis: 699,00 EUR

Zum Angebot
🔥 Bestseller

Lenovo ThinkPad USB-C Dock Gen 2 40AS Dockingstation inkl. 90 Watt Netzteil 40AS0090EU 03X7609

Lenovo ThinkPad USB-C Dock Gen 2 40AS Dockingstation inkl. 90 Watt Netzteil 40AS0090EU 03X7609

Preis: 109,00 EUR

Zum Angebot
🔥 Bestseller

HP ZBook Fury 15 G7 15,6 Zoll 1920x1080 Full HD Intel Core i7 512GB SSD 32GB Windows 11 Pro Nvidia Quadro T1000

HP ZBook Fury 15 G7 15,6 Zoll 1920x1080 Full HD Intel Core i7 512GB SSD 32GB Windows 11 Pro Nvidia Quadro T1000

Preis: 879,00 EUR

Zum Angebot
🔥 Bestseller

Lenovo ThinkStation P330 Tower Gen 2 Intel Core i7 512GB SSD 32GB Windows 11 Pro Nvidia Quadro RTX 4000

Lenovo ThinkStation P330 Tower Gen 2 Intel Core i7 512GB SSD 32GB Windows 11 Pro Nvidia Quadro RTX 4000

Preis: 899,00 EUR

Zum Angebot
🔥 Bestseller

Lenovo ThinkCentre neo 50q Gen 4 Intel Core i5-13420H 512GB SSD 16GB Windows 11 Pro inkl. W-Lan - Neugerät

Lenovo ThinkCentre neo 50q Gen 4 Intel Core i5-13420H 512GB SSD 16GB Windows 11 Pro inkl. W-Lan - Neugerät

Preis: 679,00 EUR

Zum Angebot
🔥 Bestseller

Lenovo ThinkPad P15 Gen 1 15,6 Zoll Full HD Intel Core i7 512GB SSD 32GB Windows 11 Pro Nvidia Quadro T2000

Lenovo ThinkPad P15 Gen 1 15,6 Zoll Full HD Intel Core i7 512GB SSD 32GB Windows 11 Pro Nvidia Quadro T2000

Preis: 879,00 EUR

Zum Angebot
🔥 Bestseller

Acer B246HYLBymiprx dunkelgrau 23,8 Zoll Full HD 1920x1080 DisplayPort HDMI VGA Höhenverstellbar UM.QB6EE.A05

Acer B246HYLBymiprx dunkelgrau 23,8 Zoll Full HD 1920x1080 DisplayPort HDMI VGA Höhenverstellbar UM.QB6EE.A05

Preis: 119,00 EUR

Zum Angebot

Fujitsu Esprimo Q957 Intel Core i3 128GB SSD + 500GB HDD 8GB Windows 10 Home

Fujitsu Esprimo Q957 Intel Core i3 128GB SSD + 500GB HDD 8GB Windows 10 Home

Preis: 219,00 EUR

Zum Angebot

MSA-1 Monitorschwenkarm High Quality, Aluminium silbergrau, inkl. Tischbefestigung

MSA-1 Monitorschwenkarm High Quality, Aluminium silbergrau, inkl. Tischbefestigung

Preis: 169,00 EUR

Zum Angebot

Eizo FlexScan EV2736W-BK LED IPS 27 Zoll WQHD 2560x1440 DisplayPort DVI Schwarz

Eizo FlexScan EV2736W-BK LED IPS 27 Zoll WQHD 2560x1440 DisplayPort DVI Schwarz

Preis: 219,00 EUR

Zum Angebot

Apple iPhone 11 Smartphone Handy 6,1 Zoll 128GB Speicher Schwarz

Apple iPhone 11 Smartphone Handy 6,1 Zoll 128GB Speicher Schwarz

Preis: 309,00 EUR

Zum Angebot
🔥 Bestseller

Lenovo ThinkPad L15 Gen 3 15,6 Zoll 1920x1080 Full HD AMD Ryzen 5 PRO 512GB SSD 16GB Windows 11 Pro Fingerprint

Lenovo ThinkPad L15 Gen 3 15,6 Zoll 1920x1080 Full HD AMD Ryzen 5 PRO 512GB SSD 16GB Windows 11 Pro Fingerprint

Preis: 709,00 EUR

Zum Angebot
🔥 Bestseller

Lenovo ThinkVision P27h-10 schwarz 27 Zoll WQHD 2560x1440 HDMI DisplayPort USB Höhenverstellbar 61AFGAT1EU

Lenovo ThinkVision P27h-10 schwarz 27 Zoll WQHD 2560x1440 HDMI DisplayPort USB Höhenverstellbar 61AFGAT1EU

Preis: 219,00 EUR

Zum Angebot
🔥 Bestseller

HP ZBook Firefly 14 G9 14 Zoll 1920x1200 WUXGA Intel Core i7 512GB SSD 16GB Windows 10 Pro Fingerprint

HP ZBook Firefly 14 G9 14 Zoll 1920x1200 WUXGA Intel Core i7 512GB SSD 16GB Windows 10 Pro Fingerprint

Preis: 679,00 EUR

Zum Angebot
🔥 Bestseller

Lenovo ThinkPad P15 Gen 1 15,6 Zoll Full HD Intel Core i7 512GB SSD 32GB Windows 11 Pro Nvidia Quadro T1000

Lenovo ThinkPad P15 Gen 1 15,6 Zoll Full HD Intel Core i7 512GB SSD 32GB Windows 11 Pro Nvidia Quadro T1000

Preis: 859,00 EUR

Zum Angebot

AOC I2475PXQU-GR Pro-line LED grau 23,8 Zoll Full HD 1920x1080 DisplayPort HDMI DVI-D VGA USB Höhenverstellbar

AOC I2475PXQU-GR Pro-line LED grau 23,8 Zoll Full HD 1920x1080 DisplayPort HDMI DVI-D VGA USB Höhenverstellbar

Preis: 119,00 EUR

Zum Angebot

Eizo FlexScan EV2436WFS-GY Lichtgrau 24 Zoll WUXGA 1920x1200 DisplayPort DVI VGA

Eizo FlexScan EV2436WFS-GY Lichtgrau 24 Zoll WUXGA 1920x1200 DisplayPort DVI VGA

Preis: 139,00 EUR

Zum Angebot
🔥 Bestseller

Lenovo ThinkCentre M70q Gen 5 Tiny Intel Core i5 256GB SSD 16GB Windows 11 Pro inkl. W-Lan - Neugerät

Lenovo ThinkCentre M70q Gen 5 Tiny Intel Core i5 256GB SSD 16GB Windows 11 Pro inkl. W-Lan - Neugerät

Preis: 749,00 EUR

Zum Angebot
>

Authorization code flow – Step by Step

Authorization code flow

Authorization code flow

Im Kontext unseres Beispiels:

  • User = Anwenderinnen/Anwender
  • Client/Application = Spring Boot Demo Application
  • IDP = Identity Provider Keycloak

Die Demo-Anwendung authorization-code-flow zielt darauf ab, Entwicklern einen praktischen Leitfaden zu bieten, wie sie den Authorization Code Flow und den Resource Owner Password Credentials Flow in ihren Projekten umsetzen können, um eine sichere und effiziente Benutzerverwaltung zu gewährleisten.

Konfiguration der Projektstruktur und Abhängigkeiten

Die Grundlage unserer Demo-Anwendung ist ein Maven-Projekt, welches das Spring Boot Framework nutzt. Spring Boot erleichtert uns die Konfiguration und das Setup, damit wir uns auf die wichtigen Aspekte der Keycloak-Integration konzentrieren können.

Hier ist ein Überblick über die wesentlichen Teile der `pom.xml`, die für unser Projekt konfiguriert wurden:

  • Spring Boot Starter Parent: Durch die Nutzung des `spring-boot-starter-parent` mit der Version 3.0.4 stellen wir sicher, dass unser Projekt auf der neuesten stabilen Spring Boot Version aufbaut. Dies ermöglicht uns, von den neuesten Features und Verbesserungen zu profitieren.
  • Java-Version: Mit `maven.compiler.source` und `maven.compiler.target` auf Version `17` eingestellt, verwenden wir eine aktuelle Version mit stabilen Features der Java-Sprache, was uns verbesserte Performance und eine modernere Syntax bietet.
  • Spring Boot Starter Web: Diese Abhängigkeit zieht alles Notwendige für die Erstellung einer Webanwendung heran, inklusive Tomcat als embedded Servlet Container und Spring MVC.
  • Spring Boot Starter Security und Spring Security OAuth2 Resource Server: Diese Pakete bieten die Tools, um unsere Anwendung abzusichern und den Schutz unserer Endpunkte über OAuth2 Token zu gewährleisten
  • Spring Boot Starter OAuth2 Client: Damit wird die Anwendung um die Fähigkeit erweitert, sich als OAuth2-Client zu authentifizieren, was für die Kommunikation mit Keycloak notwendig ist.
  • Lombok: Durch diese Bibliothek reduzieren wir den zu schreibenden Boilerplate-Code erheblich, was unsere Anwendung übersichtlicher und wartbarer macht.
  • Spring Boot Maven Plugin: Dieses Plugin hilft uns, die Anwendung zu verpacken und auszuführen.

Der Controller der Demo-Anwendung

Unsere Demo-Anwendung verwendet einen Spring-Controller, um verschiedene Endpunkte für unsere Webanwendung bereitzustellen. Jede Methode im Controller ist einem spezifischen Pfad zugeordnet und definiert, was passiert, wenn ein Benutzer diesen Pfad aufruft.

Basis-Endpunkte

  • @GetMapping("/") Das Root-Verzeichnis der Anwendung leitet einfach zur `index.html` weiter, welche als unsere Startseite fungiert.
  • @GetMapping("/public") Der öffentliche Endpunkt, zu dem jeder Zugang hat, ohne sich authentifizieren zu müssen.
  • @GetMapping("/secured") Ein gesicherter Endpunkt, der nur nach erfolgreicher Authentifizierung erreichbar ist.

Rollenbasierte Zugriffskontrolle

Unsere Anwendung implementiert rollenbasierte Zugriffskontrolle mit benutzerdefinierten Annotations:

  • @GetMapping("/realm-admin-realm-user-only")
    @CustomRolesAllowed({"admin", "user"})
    Dieser Endpunkt ist nur für Benutzer mit den Rollen „admin“oder „user“ im Realm zugänglich.
  • @GetMapping("/realm-admin-only")
    @RealmAdminOnly
    Spezifisch für Realm-Administratoren.
  • @GetMapping("/resource-admin-only")
    @ResourceAdminOnly(resource = "athen", role = "client_admin")
    Hier wird der Zugriff auf Benutzer beschränkt, die in einer bestimmten Resource in diesem Fall client-id „athen“ die Rolle „client_admin“ haben.
  • @GetMapping("/composite-role-endpoint")
    @CompositeRoles({"athen:client_admin", "olymp:admin"})
    Zugänglich für Benutzer, die komplexe Rollenanforderungen erfüllen, hier sowohl „client_admin“ in Client-id „athen“ als auch „admin“ in Realm „olymp“

Logout-Funktionalität

  • @GetMapping("/logout")
    Hier wird der Benutzer ausgeloggt. Die Spring-Security-Infrastruktur kümmert sich darum, den `Authentication`-Kontext zu leeren und die Sitzung zu invalidieren.

Werbung/Advertising

<

Windows Server 2019 CALS

Windows Server 2019 CALS

Preis: 87,90 EUR

Zum Angebot

Office 2024 Home

Office 2024 Home

Preis: 44,90 EUR

Zum Angebot

Adobe Acrobat Standard 2020 OEM

Adobe Acrobat Standard 2020 OEM

Preis: 900,00 EUR

Zum Angebot

McAfee Total Protection

McAfee Total Protection

Preis: 15,00 EUR

Zum Angebot

Windows 10 Home

Windows 10 Home

Preis: 14,90 EUR

Zum Angebot

Microsoft Windows Server 2022 Datacenter

Microsoft Windows Server 2022 Datacenter

Preis: 219,00 EUR

Zum Angebot

AVG Ultimate

AVG Ultimate

Preis: 25,00 EUR

Zum Angebot

Microsoft Office 2021 Standard

Microsoft Office 2021 Standard

Preis: 24,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 2021 Professional Plus + Windows 11 Professional GRATIS

Office 2021 Professional Plus + Windows 11 Professional GRATIS

Preis: 24,90 EUR

Zum Angebot

Bitdefender Antivirus Plus

Bitdefender Antivirus Plus

Preis: 50,00 EUR

Zum Angebot

Microsoft Word 2021

Microsoft Word 2021

Preis: 14,90 EUR

Zum Angebot

Office 2019 Home and Business

Office 2019 Home and Business

Preis: 19,90 EUR

Zum Angebot

Panda Dome Complete MD

Panda Dome Complete MD

Preis: 25,00 EUR

Zum Angebot

Office 2019 Professional plus

Office 2019 Professional plus

Preis: 39,90 EUR

Zum Angebot

Microsoft Office 2019 Standard

Microsoft Office 2019 Standard

Preis: 19,90 EUR

Zum Angebot

Office 2024 Professional

Office 2024 Professional

Preis: 39,90 EUR

Zum Angebot

Office 2021 Professional

Office 2021 Professional

Preis: 19,90 EUR

Zum Angebot

Windows 11 Pro

Windows 11 Pro

Preis: 14,90 EUR

Zum Angebot

McAfee VPN Safe Connect

McAfee VPN Safe Connect

Preis: 30,00 EUR

Zum Angebot

Office 2024 Professional Plus

Office 2024 Professional Plus

Preis: 29,99 EUR

Zum Angebot

Office 2021 Home and Business

Office 2021 Home and Business

Preis: 24,90 EUR

Zum Angebot

Windows Server 2016

Windows Server 2016

Preis: 99,90 EUR

Zum Angebot

Office 2021 Professional Plus

Office 2021 Professional Plus

Preis: 19,90 EUR

Zum Angebot

Panda Dome Advanced MD

Panda Dome Advanced MD

Preis: 15,00 EUR

Zum Angebot

Office 2016 Professional

Office 2016 Professional

Preis: 14,90 EUR

Zum Angebot

Windows Server 2016 CALS

Windows Server 2016 CALS

Preis: 64,90 EUR

Zum Angebot

Microsoft Word 2016

Microsoft Word 2016

Preis: 14,90 EUR

Zum Angebot

Windows 10 Pro

Windows 10 Pro

Preis: 14,90 EUR

Zum Angebot

Office 2019 Professional Plus

Office 2019 Professional Plus

Preis: 14,90 EUR

Zum Angebot

Kaspersky Mobile

Kaspersky Mobile

Preis: 25,00 EUR

Zum Angebot

Office 2016 Home and Business

Office 2016 Home and Business

Preis: 14,90 EUR

Zum Angebot

Panda Dome Essential MD

Panda Dome Essential MD

Preis: 15,00 EUR

Zum Angebot

Microsoft Windows Server 2022

Microsoft Windows Server 2022

Preis: 349,90 EUR

Zum Angebot

AVG TuneUp ESD

AVG TuneUp ESD

Preis: 25,00 EUR

Zum Angebot

Visio 2019 Professional

Visio 2019 Professional

Preis: 14,90 EUR

Zum Angebot

AVG Internet Security

AVG Internet Security

Preis: 25,00 EUR

Zum Angebot

Office 2021 Home and Student

Office 2021 Home and Student

Preis: 19,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

Windows 10/11 Home

Windows 10/11 Home

Preis: 14,90 EUR

Zum Angebot

Avast Premium Security

Avast Premium Security

Preis: 20,00 EUR

Zum Angebot

Norton 360 Deluxe inkl. 25GB MD

Norton 360 Deluxe inkl. 25GB MD

Preis: 25,00 EUR

Zum Angebot

Bitdefender Premium VPN

Bitdefender Premium VPN

Preis: 90,00 EUR

Zum Angebot

Microsoft Excel 2019

Microsoft Excel 2019

Preis: 14,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

Adobe Photoshop Elements 2025

Adobe Photoshop Elements 2025

Preis: 190,00 EUR

Zum Angebot

Windows Server 2016 RDS CALS

Windows Server 2016 RDS CALS

Preis: 64,90 EUR

Zum Angebot

Microsoft Word 2019

Microsoft Word 2019

Preis: 14,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

Microsoft Excel 2021

Microsoft Excel 2021

Preis: 19,90 EUR

Zum Angebot

Windows Server 2022 CALS

Windows Server 2022 CALS

Preis: 99,90 EUR

Zum Angebot

Windows 10/11 Pro

Windows 10/11 Pro

Preis: 19,90 EUR

Zum Angebot

Office 2016 Home and Student

Office 2016 Home and Student

Preis: 14,90 EUR

Zum Angebot

Visio 2016 Professional

Visio 2016 Professional

Preis: 14,90 EUR

Zum Angebot

Windows Server 2019 RDS CALS

Windows Server 2019 RDS CALS

Preis: 93,90 EUR

Zum Angebot

Windows 11 Home

Windows 11 Home

Preis: 19,90 EUR

Zum Angebot

Microsoft Powerpoint 2019

Microsoft Powerpoint 2019

Preis: 29,90 EUR

Zum Angebot

Office 2019 Professional

Office 2019 Professional

Preis: 39,90 EUR

Zum Angebot

Office 2019 Home and Student

Office 2019 Home and Student

Preis: 19,90 EUR

Zum Angebot

McAfee Internet Security

McAfee Internet Security

Preis: 25,00 EUR

Zum Angebot

ESET NOD32 Antivirus

ESET NOD32 Antivirus

Preis: 50,00 EUR

Zum Angebot

mySteganos Online Shield VPN

mySteganos Online Shield VPN

Preis: 55,00 EUR

Zum Angebot

Windows Server 2022 RDS CALS

Windows Server 2022 RDS CALS

Preis: 109,90 EUR

Zum Angebot
>

Absicherung der Endpunkte durch die Spring Security und TokenUtils Klasse

Die Sicherung der Endpunkte in unserer Anwendung wird durch benutzerdefinierte Annotationen wie @CustomRolesAllowed, @RealmAdminOnly, @ResourceAdminOnly und @CompositeRoles gewährleistet. Diese Annotationen stellen eine effektive Methode dar, um spezifische Sicherheitslogiken zu implementieren. Indem sie direkt in den Controller-Code integriert werden, verbessern sie nicht nur die Lesbarkeit, sondern auch die Wartbarkeit der Zugriffskontrollregeln.

Jede dieser Annotations arbeitet mit der `TokenUtils` – Klasse zusammen, um zu überprüfen, ob der aktuelle Benutzer die erforderlichen Rollen für den Zugriff auf einen Endpunkt besitzt. Dies zeigt die Flexibilität von Spring Security, wenn es um die Erweiterung und Anpassung an komplexe Sicherheitsanforderungen geht.

Diese Klasse ist ein maßgeblicher Bestandteil des Sicherheitssystems der Applikation, da sie verantwortlich für die Auwertung und die Verarbeitung von JWTs (JSON Web Tokens) ist, die von Keycloak für die Authentifizierung und Autorisierung ausgestellt werden. JWTs sind ein integraler Bestandteil moderner Authentifizierungsmechanismen in verteilten Systemen. Ein Token besteht aus drei durch Punkte getrennten Teilen: Header, Payload und Signatur. Die `TokenUtils`-Klasse konzentriert sich auf den Payload, der die relevanten Benutzeransprüche (Claims) enthält

Konfiguration und Initialisierung

Bevor die `TokenUtils` ihre Funktionen ausführen kann, muss sie mit der erforderlichen Konfiguration initialisiert werden. Konfigurationsparameter wie der `externalOauth2Provider` oder Schalter für das Logging werden über `@Value`-Annotationen geladen und steuern das Verhalten der Klasse.

Werbung/Advertising

<

Windows Server 2022 RDS CALS

Windows Server 2022 RDS CALS

Preis: 109,90 EUR

Zum Angebot

Avast Premium Security

Avast Premium Security

Preis: 20,00 EUR

Zum Angebot

Windows Server 2022 CALS

Windows Server 2022 CALS

Preis: 99,90 EUR

Zum Angebot

AVG TuneUp ESD

AVG TuneUp ESD

Preis: 25,00 EUR

Zum Angebot

Microsoft Office 2021 Standard

Microsoft Office 2021 Standard

Preis: 24,90 EUR

Zum Angebot

Windows 10 Home

Windows 10 Home

Preis: 14,90 EUR

Zum Angebot

Microsoft Word 2016

Microsoft Word 2016

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

Office 2021 Professional Plus + Windows 11 Professional Bundle

Office 2021 Professional Plus + Windows 11 Professional Bundle

Preis: 24,90 EUR

Zum Angebot

Microsoft Excel 2021

Microsoft Excel 2021

Preis: 19,90 EUR

Zum Angebot

Windows Server 2016 RDS CALS

Windows Server 2016 RDS CALS

Preis: 64,90 EUR

Zum Angebot

Windows 10/11 Home

Windows 10/11 Home

Preis: 14,90 EUR

Zum Angebot

Windows Server 2019 CALS

Windows Server 2019 CALS

Preis: 87,90 EUR

Zum Angebot

Bitdefender Antivirus Plus

Bitdefender Antivirus Plus

Preis: 50,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

Watchdog Anti-Malware Vollversion

Watchdog Anti-Malware Vollversion

Preis: 25,00 EUR

Zum Angebot

Windows Server 2016

Windows Server 2016

Preis: 99,90 EUR

Zum Angebot

Windows 11 Home

Windows 11 Home

Preis: 19,90 EUR

Zum Angebot

Microsoft Word 2021

Microsoft Word 2021

Preis: 14,90 EUR

Zum Angebot

Windows 10/11 Pro

Windows 10/11 Pro

Preis: 19,90 EUR

Zum Angebot

Office 2019 Professional plus

Office 2019 Professional plus

Preis: 39,90 EUR

Zum Angebot

McAfee Total Protection

McAfee Total Protection

Preis: 15,00 EUR

Zum Angebot

McAfee VPN Safe Connect

McAfee VPN Safe Connect

Preis: 30,00 EUR

Zum Angebot

Office 2019 Home and Business

Office 2019 Home and Business

Preis: 19,90 EUR

Zum Angebot

Norton 360 Deluxe inkl. 25GB MD

Norton 360 Deluxe inkl. 25GB MD

Preis: 25,00 EUR

Zum Angebot

Microsoft Windows Server 2022 Datacenter

Microsoft Windows Server 2022 Datacenter

Preis: 219,00 EUR

Zum Angebot

Kaspersky Mobile

Kaspersky Mobile

Preis: 25,00 EUR

Zum Angebot

Windows Server Standard 2022

Windows Server Standard 2022

Preis: 194,90 EUR

Zum Angebot

Office 2024 Home

Office 2024 Home

Preis: 44,90 EUR

Zum Angebot

Windows 11 Pro

Windows 11 Pro

Preis: 14,90 EUR

Zum Angebot

Windows Server 2016 CALS

Windows Server 2016 CALS

Preis: 64,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

Windows Server 2019 RDS CALS

Windows Server 2019 RDS CALS

Preis: 93,90 EUR

Zum Angebot

mySteganos Online Shield VPN

mySteganos Online Shield VPN

Preis: 55,00 EUR

Zum Angebot

Office 2021 Home and Student

Office 2021 Home and Student

Preis: 19,90 EUR

Zum Angebot

Office 2019 Professional

Office 2019 Professional

Preis: 39,90 EUR

Zum Angebot

Microsoft Powerpoint 2019

Microsoft Powerpoint 2019

Preis: 29,90 EUR

Zum Angebot

Microsoft Windows Server 2022

Microsoft Windows Server 2022

Preis: 349,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

Panda Dome Complete MD

Panda Dome Complete MD

Preis: 25,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

Office 2021 Professional

Office 2021 Professional

Preis: 19,90 EUR

Zum Angebot

Office 2016 Home and Business

Office 2016 Home and Business

Preis: 14,90 EUR

Zum Angebot

Office 2019 Professional Plus

Office 2019 Professional Plus

Preis: 14,90 EUR

Zum Angebot

Panda Dome Essential MD

Panda Dome Essential MD

Preis: 15,00 EUR

Zum Angebot

Adobe Acrobat Standard 2020 OEM

Adobe Acrobat Standard 2020 OEM

Preis: 900,00 EUR

Zum Angebot

Office 2024 Professional

Office 2024 Professional

Preis: 39,90 EUR

Zum Angebot

AVG Internet Security

AVG Internet Security

Preis: 25,00 EUR

Zum Angebot

Windows 10 Pro

Windows 10 Pro

Preis: 14,90 EUR

Zum Angebot

ESET NOD32 Antivirus

ESET NOD32 Antivirus

Preis: 50,00 EUR

Zum Angebot

Office 2016 Home and Student

Office 2016 Home and Student

Preis: 14,90 EUR

Zum Angebot

Office 2021 Home and Business

Office 2021 Home and Business

Preis: 24,90 EUR

Zum Angebot

AVG Ultimate

AVG Ultimate

Preis: 25,00 EUR

Zum Angebot

Visio 2016 Professional

Visio 2016 Professional

Preis: 14,90 EUR

Zum Angebot

Microsoft Excel 2019

Microsoft Excel 2019

Preis: 14,90 EUR

Zum Angebot

Pinnacle Studio 26 (2023) STANDARD Windows / Deutsch

Pinnacle Studio 26 (2023) STANDARD Windows / Deutsch

Preis: 110,00 EUR

Zum Angebot

Microsoft Office 2019 Standard

Microsoft Office 2019 Standard

Preis: 19,90 EUR

Zum Angebot

Microsoft Word 2019

Microsoft Word 2019

Preis: 14,90 EUR

Zum Angebot

Visio 2019 Professional

Visio 2019 Professional

Preis: 14,90 EUR

Zum Angebot

Panda Dome Advanced MD

Panda Dome Advanced MD

Preis: 15,00 EUR

Zum Angebot

Bitdefender Premium VPN

Bitdefender Premium VPN

Preis: 90,00 EUR

Zum Angebot
>

Kernfunktionen

  • Laden und Parsen des Tokens
    Die primäre Aufgabe der Klasse ist das Laden und Parsen des Access Tokens eines Benutzers, um Zugang zu den darin enthaltenen Informationen zu erhalten. Die Methode `loadPayload()` nimmt den Benutzernamen entgegen, lädt den entsprechenden OAuth2AuthorizedClient und extrahiert den Payload aus dem Access Token. Hierbei wird auch geprüft, ob das Token im korrekten Format vorliegt.
  • Rollen- und Rechteprüfung
    Mit Methoden wie `hasAnyRealmRole()`, `hasRealmRole()` und `hasResourceRole()` bietet `TokenUtils` die Möglichkeit, zu überprüfen, ob ein Benutzer bestimmte Rollen oder Rechte besitzt. Diese Funktionen sind entscheidend, um sicherzustellen, dass Benutzer nur auf die für sie bestimmten Ressourcen zugreifen können.
  • Zusätzliche Hilfsmethoden
    Die Klasse stellt weitere Methoden wie `getScopesFromToken()` zur Verfügung, um die Scopes eines Tokens abzurufen. Scopes sind essentiell, um zu bestimmen, auf welche Bereiche der Anwendung der Benutzer Zugriff hat.
  • Logging und Feedback
    `TokenUtils` bietet umfangreiche Logging-Funktionen, um die Token- und Rollendaten eines Benutzers für Debugging und Überwachungszwecke auszugeben. Die Methoden `printUserRolesAndAuthorities()`, `printTokens()` und `printScopes()` dienen dazu, die Token-Informationen in einem lesbaren Format auszugeben.

Anpassung und Erweiterbarkeit

Während die aktuelle Implementierung von `TokenUtils` eine breite Palette von Funktionen abdeckt, ist es möglich und erwartet, dass die Klasse angepasst oder erweitert wird, um spezifische Sicherheitsanforderungen eines Projekts zu erfüllen.

Die TokenUtils-Klasse ist ein unverzichtbares Werkzeug in unserer Anwendung, die mit Keycloak als Authentifizierungsprovider arbeitet und speziell als Teil unserer Demo für Trainingszwecke konzipiert wurde. Sie bietet eine zuverlässige Schnittstelle zum Laden, Parsen und Inspektieren von OAuth2-Token, um die Sicherheitsmechanismen der Anwendung zu unterstützen. Wichtig zu beachten ist, dass das Logging von Token-Informationen ausschließlich zu Trainings- und Testzwecken in einer sicheren Testumgebung empfohlen wird. In einer Produktionsumgebung sollten Token-Informationen aus Sicherheitsgründen nicht geloggt werden, um das Risiko von Datenlecks und anderen Sicherheitsbedrohungen zu minimieren.

Wir sind am Ende unserer Entdeckungsreise angelangt! Sie haben jetzt einen umfassenden Einblick in die Welt des Authorization Code Flows mittels der Spring Boot Keycloak-Demo-Anwendung erhalten. Online-Sicherheit ist kein Hexenwerk, sondern das Resultat sorgfältig entwickelter und implementierter Mechanismen. Mit der Einbindung des Authorization Code Flows in Ihre Projekte können Sie nicht nur die Sicherheit Ihrer Anwendungen erheblich steigern, sondern bieten Ihren Nutzern auch eine komfortable Authentifizierungserfahrung. Ich hoffe, dass dieser Blog-Post für Sie hilfreich war und bin gespannt darauf, wie Sie diese Techniken in Ihren eigenen Projekten umsetzen werden. Bleiben Sie sicher und viel Spaß beim Programmieren!

Mit nur wenigen Anpassungen kann über die Demo-Anwendung auch der Ressource Owner Password Credentials Flow realisiert werden. Das zeige ich im nächsten Beitrag. Einfach wieder reinschauen.

Werbung/Advertising

<

McAfee Internet Security

McAfee Internet Security

Preis: 25,00 EUR

Zum Angebot

Microsoft Word 2016

Microsoft Word 2016

Preis: 14,90 EUR

Zum Angebot

Office 2019 Professional Plus

Office 2019 Professional Plus

Preis: 14,90 EUR

Zum Angebot

Bitdefender Premium VPN

Bitdefender Premium VPN

Preis: 90,00 EUR

Zum Angebot

Windows 11 Pro

Windows 11 Pro

Preis: 14,90 EUR

Zum Angebot

Windows 10/11 Pro

Windows 10/11 Pro

Preis: 19,90 EUR

Zum Angebot

Visio 2016 Professional

Visio 2016 Professional

Preis: 14,90 EUR

Zum Angebot

Office 2024 Home

Office 2024 Home

Preis: 44,90 EUR

Zum Angebot

Avast Premium Security

Avast Premium Security

Preis: 20,00 EUR

Zum Angebot

Office 2021 Professional Plus

Office 2021 Professional Plus

Preis: 19,90 EUR

Zum Angebot

Microsoft Windows Server 2022 Datacenter

Microsoft Windows Server 2022 Datacenter

Preis: 219,00 EUR

Zum Angebot

Norton 360 Deluxe inkl. 25GB MD

Norton 360 Deluxe inkl. 25GB MD

Preis: 25,00 EUR

Zum Angebot

Windows Server 2022 CALS

Windows Server 2022 CALS

Preis: 99,90 EUR

Zum Angebot

Adobe Acrobat Standard 2020 OEM

Adobe Acrobat Standard 2020 OEM

Preis: 900,00 EUR

Zum Angebot

Windows Server 2019 CALS

Windows Server 2019 CALS

Preis: 87,90 EUR

Zum Angebot

Office 2024 Professional Plus

Office 2024 Professional Plus

Preis: 29,99 EUR

Zum Angebot

Microsoft Powerpoint 2019

Microsoft Powerpoint 2019

Preis: 29,90 EUR

Zum Angebot

Windows Server Standard 2022

Windows Server Standard 2022

Preis: 194,90 EUR

Zum Angebot

Microsoft Word 2021

Microsoft Word 2021

Preis: 14,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 2019 Home and Business

Office 2019 Home and Business

Preis: 19,90 EUR

Zum Angebot

Microsoft Word 2019

Microsoft Word 2019

Preis: 14,90 EUR

Zum Angebot

AVG TuneUp ESD

AVG TuneUp ESD

Preis: 25,00 EUR

Zum Angebot

Office 2021 Professional

Office 2021 Professional

Preis: 19,90 EUR

Zum Angebot

Watchdog Anti-Malware Vollversion

Watchdog Anti-Malware Vollversion

Preis: 25,00 EUR

Zum Angebot

Office 2016 Professional

Office 2016 Professional

Preis: 14,90 EUR

Zum Angebot

Bitdefender Antivirus Plus

Bitdefender Antivirus Plus

Preis: 50,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

mySteganos Online Shield VPN

mySteganos Online Shield VPN

Preis: 55,00 EUR

Zum Angebot

Microsoft Office 2019 Standard

Microsoft Office 2019 Standard

Preis: 19,90 EUR

Zum Angebot

Office 2021 Home and Student

Office 2021 Home and Student

Preis: 19,90 EUR

Zum Angebot

Pinnacle Studio 26 (2023) STANDARD Windows / Deutsch

Pinnacle Studio 26 (2023) STANDARD Windows / Deutsch

Preis: 110,00 EUR

Zum Angebot

Windows 10 Home

Windows 10 Home

Preis: 14,90 EUR

Zum Angebot

Windows Server 2016 CALS

Windows Server 2016 CALS

Preis: 64,90 EUR

Zum Angebot

Office 2019 Professional plus

Office 2019 Professional plus

Preis: 39,90 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

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

Office 2019 Home and Student

Office 2019 Home and Student

Preis: 19,90 EUR

Zum Angebot

AVG Internet Security

AVG Internet Security

Preis: 25,00 EUR

Zum Angebot

Kaspersky Mobile

Kaspersky Mobile

Preis: 25,00 EUR

Zum Angebot

Panda Dome Advanced MD

Panda Dome Advanced MD

Preis: 15,00 EUR

Zum Angebot

Office 2016 Home and Student

Office 2016 Home and Student

Preis: 14,90 EUR

Zum Angebot

Windows Server 2016 RDS CALS

Windows Server 2016 RDS CALS

Preis: 64,90 EUR

Zum Angebot

McAfee Total Protection

McAfee Total Protection

Preis: 15,00 EUR

Zum Angebot

Windows 10/11 Home

Windows 10/11 Home

Preis: 14,90 EUR

Zum Angebot

Microsoft Excel 2021

Microsoft Excel 2021

Preis: 19,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

Panda Dome Essential MD

Panda Dome Essential MD

Preis: 15,00 EUR

Zum Angebot

Windows Server 2016

Windows Server 2016

Preis: 99,90 EUR

Zum Angebot

Windows 10 Pro

Windows 10 Pro

Preis: 14,90 EUR

Zum Angebot

Office 2021 Home and Business

Office 2021 Home and Business

Preis: 24,90 EUR

Zum Angebot

Visio 2019 Professional

Visio 2019 Professional

Preis: 14,90 EUR

Zum Angebot

Microsoft Office 2021 Standard

Microsoft Office 2021 Standard

Preis: 24,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

AVG Ultimate

AVG Ultimate

Preis: 25,00 EUR

Zum Angebot

Office 2016 Home and Business

Office 2016 Home and Business

Preis: 14,90 EUR

Zum Angebot

Office 2024 Professional

Office 2024 Professional

Preis: 39,90 EUR

Zum Angebot

Microsoft Windows Server 2022

Microsoft Windows Server 2022

Preis: 349,90 EUR

Zum Angebot

Office 2019 Professional

Office 2019 Professional

Preis: 39,90 EUR

Zum Angebot

Windows Server 2019 RDS CALS

Windows Server 2019 RDS CALS

Preis: 93,90 EUR

Zum Angebot

McAfee VPN Safe Connect

McAfee VPN Safe Connect

Preis: 30,00 EUR

Zum Angebot
>