dev: run keycloak with --proxy-headers xforwarded (fix cross-site OIDC cookies)#6
Merged
Merged
Conversation
…C cookies) The image entrypoint (entry-keycloak.sh) hardcodes 'kc.sh start --proxy-headers forwarded', a CLI flag that overrides KC_PROXY_HEADERS=xforwarded and expects the RFC 7239 Forwarded header. The Tailscale ingress only sends X-Forwarded-* headers, so keycloak ignored the forwarded scheme -> 'Non-secure context' -> cross-site OIDC cookies (AUTH_SESSION_ID) dropped -> cookie_not_found / invalid_code on the thunderbird-accounts login. Override the dev entrypoint to use --proxy-headers xforwarded (replicating the start + MFA reconcile). Proper fix: make entry-keycloak.sh honor KC_PROXY_HEADERS in the image (thunderbird-accounts). Part of thunderbird/platform-infrastructure#599 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The image entrypoint
scripts/entry-keycloak.shhardcodeskc.sh start --http-enabled=true --proxy-headers forwarded. That CLI flag overridesKC_PROXY_HEADERS=xforwardedand makes keycloak expect the RFC 7239Forwardedheader — but the Tailscale ingress only sendsX-Forwarded-*, so keycloak ignored the forwarded scheme, resolved the request as a non-secure context, and dropped the cross-site OIDCAUTH_SESSION_IDcookie →cookie_not_found/invalid_codeon thethunderbird-accountslogin (confirmed: keycloak events logged the pod IP, not the client IP — X-Forwarded-* not honored).This overrides the dev keycloak start command to use
--proxy-headers xforwarded(faithfully replicating the entrypoint: background start +apply-mfa-config.sh). Validated on dev next.Proper long-term fix: make
entry-keycloak.shhonorKC_PROXY_HEADERS(defaultforwardedso ECS is unchanged; EKS setsxforwarded) — an image change inthunderbird-accounts. Part of thunderbird/platform-infrastructure#599.