Token-Validierung

JWT-Algorithmus und -Struktur in Token-Responses von Keycloak validieren.

Anforderungsabdeckung

REQ-TOKEN-001

Enforce allowed JWT signing algorithms

REQ-TOKEN-002

Validate token lifetime against configurable maximum

REQ-TOKEN-003

Detect claim leakage in token payload

REQ-TOKEN-004

Enforce maximum token size

REQ-TOKEN-005

Validate JWT structure

REQ-TOKEN-006

Block tokens with malformed characters

Testbeispiele

TOKEN-001BLOCKIERT

'none'-Algorithmus in Response blockiert

Beispiel-Request

# Antwort von Keycloak enthält Token mit alg: none
# ALG erkennt und blockiert vor Weiterleitung an Client

Erwartete Antwort

{"error":"server_error","error_description":"Token algorithm 'none' is not allowed"}
TOKEN-002BLOCKIERT

Übergroßer Token blockiert

Beispiel-Request

# Antwort von Keycloak enthält Token > max_token_size_bytes
# ALG erkennt Role/Claim-Enrichment-Missbrauch

Erwartete Antwort

{"error":"server_error","error_description":"Token size exceeds maximum allowed size"}