BFF-Routen: Account-REST-API durch AIA-Redirects ersetzen #164
Labels
No labels
component/backend
component/docs
component/e2e
component/frontend
component/infra
component/keycloak
prio/high
prio/low
prio/medium
type/bug
type/chore
type/feature
type/refactor
type/test
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
WompSchmiede/FamilienFeierPlaner#164
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Background
Sae mtliche
/api/auth/*BFF-Routen rufencallKeycloakAccountApi()auf, die Keycloaks Account-REST-API v2 unter/realms/{realm}/account/nutzt. Ab Keycloak 22+ existiert diese API nicht mehr — alle Aufrufe schlagen mit HTTP 404 fehl, wie der Debug-Log gezeigt hat:Loesung
Application Initiated Actions (AIA): Statt REST-Calls wird der User per OIDC-Redirect mit
kc_actionzu Keycloak geschickt. Keycloak zeigt das entsprechende Formular, und nach Abschluss wird der User mitkc_action_status=success|cancelled|errorzurueck zum Callback geleitet.Scope
1.
frontend/src/routes/api/auth/change-password/+server.tsPOST-Handler erzeugt PKCE-Authorization-URL mit
kc_action=UPDATE_PASSWORDund gibt{ redirectUrl }zurueck (analoglogin/+server.ts).2.
frontend/src/routes/api/auth/credentials/totp/+server.tsGET und POST ersetzen durch AIA
CONFIGURE_TOTP(gleiches Redirect-Pattern). POST zum Verifizieren des TOTP-Codes entfaellt (Keycloak uebernimmt das).3.
frontend/src/routes/api/auth/credentials/passkey/register/+server.tsPOST ersetzen durch AIA
webauthn-register-passwordless.4.
frontend/src/routes/api/auth/credentials/[id]/+server.tskc_action=delete_credential:{credentialId}(parametrisierte AIA)5.
frontend/src/routes/api/auth/credentials/+server.tsGET entfaellt — Credential-Liste wird nicht mehr per API abgerufen. User verwalten Credentials direkt in der Keycloak Account Console oder ueber die AIA-Aktionen.
6.
frontend/src/routes/callback/+server.tskc_action_status-Parameter auswerten:success→ Redirect zu/app/account?action={type}&status=successcancelled→/app/account?action={type}&status=cancellederror→/app/account?action={type}&status=error7.
frontend/src/routes/app/account/+page.svelte?action=password&status=success8. i18n
Neue Keys in
frontend/src/lib/i18n/de/account.jsonfuer:9.
callKeycloakAccountApi()entfernenNachdem alle Caller migriert sind,
callKeycloakAccountApi()ausfrontend/src/lib/server/auth.tsentfernen.Test
Manuell im Browser:
Erwartet: Keycloak zeigt nach SSO-Login den Passwort-aendern-Dialog.
Milestone MS-SECURITY wird geschlossen.
Erledigt in:
aad6148— i18n von Svelte-Stores auf $state-Runes migriertcbaca24— tokens.css des Account-Themes in .gitignore aufgenommen