Skip to content

fix(crossview): OIDC redirect_uri is built from the request, not OIDC_CALLBACK_URLΒ #3172

Description

@devantler

πŸ€– Generated by the Agentic Engineer

Evidence

Login to Crossview fails at Dex with Unregistered redirect_uri ("http://crossview.platform.devantler.tech/api/auth/oidc/callback").

#3171 fixes the proven half β€” the app never rolls when its ConfigMap changes, so it was running a
stale OIDC_CALLBACK_URL. This issue tracks a second, independent problem that a restart may not
resolve, and it is the one that decides whether login actually works.

The redirect_uri Dex received matches neither the config the pod is running nor the config in
Git:

Source Value
Pod's env at the time (from the pre-#2741 ConfigMap) http://localhost:3001/api/auth/oidc/callback
Git / current ConfigMap https://crossview.platform.devantler.tech/api/auth/oidc/callback
What Dex actually received http://crossview.platform.devantler.tech/api/auth/oidc/callback

The host is the public route, the scheme is http, and the path is the app's fixed
callback route. That combination is only explicable if Crossview builds the authorization request's
redirect_uri from the incoming request (Host header + connection scheme) rather than using
OIDC_CALLBACK_URL verbatim. The hop into the pod is plaintext (Gateway β†’ oauth2-proxy β†’ auth-proxy β†’
Crossview), so the scheme it observes is http.

Supporting facts, all measured read-only in prod:

  • OIDC_CALLBACK_URL reaches the container only via env[].valueFrom.configMapKeyRef.
  • The active ReplicaSet crossview-55d64b565 dates from 2026-07-05; the pod template has not
    changed since, and the container has restarts=0 since 16:26:36Z.
  • crossview-config was last written by helm-controller at 16:48:08Z β€” after the container started.

Why it matters

If Crossview derives the origin, then #3171 plus a restart is not sufficient: the app will still
send http://… and Dex will still reject it, because Dex matches redirect URIs exactly.

Expected behaviour

Crossview sends https://crossview.platform.devantler.tech/api/auth/oidc/callback β€” the value already
registered on the shared Dex client.

Candidate fixes, in preference order

  1. Make Crossview honour the forwarded scheme. Confirm whether it reads X-Forwarded-Proto, and
    ensure that header reaches it as https. The route already sets X-Auth-Request-Redirect for
    oauth2-proxy, but nothing sets X-Forwarded-Proto for Crossview itself.
  2. Make it use OIDC_CALLBACK_URL verbatim β€” an upstream fix or a chart/config option, if one
    exists for the authorize step.
  3. ❌ Do not register the http:// variant on the Dex client. That makes Dex accept a plaintext
    redirect target for a public route and trades the vulnerability for the symptom.

Acceptance criteria

  • A login through the public route completes end to end.
  • Dex receives an https:// redirect_uri (confirmable from a Dex log line or a failed-request body).
  • The Dex client still registers only the HTTPS callback.
  • A negative control: reverting the fix reproduces the http:// redirect_uri, so the fix is shown to
    be what changed the behaviour.

Blocked by

#3171 β€” land the reload fix first, restart, and re-observe. If login then works, Crossview does use
the configured value and this issue closes as not-reproducible with that recorded.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    Status
    βœ… Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions