Fix OIDC login immediate logout — rename JWT subject prefix ui: → user:
All checks were successful
CI / build (push) Successful in 1m12s
CI / docker (push) Successful in 41s
CI / deploy (push) Successful in 30s

OIDC tokens had subject "oidc:<sub>" which didn't match the "ui:" prefix
check in JwtAuthenticationFilter, causing every post-login API call to
return 401 and trigger automatic logout. Renamed the prefix from "ui:"
to "user:" across all auth code for clarity (it covers both browser and
API clients, not just UI).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-03-14 15:55:10 +01:00
parent 465f210aee
commit 6676e209c7
6 changed files with 16 additions and 16 deletions

View File

@@ -14,7 +14,7 @@ public interface JwtService {
/**
* Validated JWT payload.
*
* @param subject the {@code sub} claim (agent ID or {@code ui:<username>})
* @param subject the {@code sub} claim (agent ID or {@code user:<username>})
* @param group the {@code group} claim
* @param roles the {@code roles} claim (e.g. {@code ["AGENT"]}, {@code ["ADMIN"]})
*/

View File

@@ -6,7 +6,7 @@ import java.util.List;
/**
* Represents a persisted user in the system.
*
* @param userId unique identifier (e.g. OIDC {@code sub} or {@code ui:<username>})
* @param userId unique identifier (e.g. OIDC {@code sub} or {@code user:<username>})
* @param provider authentication provider ({@code "local"}, {@code "oidc:<issuer-host>"})
* @param email user email (may be empty)
* @param displayName display name (may be empty)