Skip to content

[PLT-3581] Add configurable sign-out URL via --sign-out-url / OAUTH2_PROXY_SIGN_OUT_URL#29

Open
majimenez-stratio wants to merge 4 commits into
masterfrom
feature/configurable-sign-out-url
Open

[PLT-3581] Add configurable sign-out URL via --sign-out-url / OAUTH2_PROXY_SIGN_OUT_URL#29
majimenez-stratio wants to merge 4 commits into
masterfrom
feature/configurable-sign-out-url

Conversation

@majimenez-stratio
Copy link
Copy Markdown
Collaborator

@majimenez-stratio majimenez-stratio commented May 12, 2026

Summary

  • The --sign-out-url flag was already registered in options.go but never wired to any struct field — it was effectively dead code.
  • This PR connects it end-to-end so deployments can override the provider's default sign-out redirect URL without changing OAUTH2_PROXY_SIS_ROOT_URL.
  • Fixes a bug where existing query params in the sign-out URL (e.g. ?appId=5784) were dropped when appending the rd redirect parameter.
  • Needed for non-standard IdP logout flows (e.g. Autentica/REDSARA) where the IdP exposes a proprietary logout endpoint instead of OIDC RP-Initiated Logout.

Changes

File Change
pkg/apis/options/providers.go Add SignOutURL string field to Provider struct
pkg/apis/options/legacy_options.go Add SignOutURL to LegacyProvider with flag:"sign-out-url" + map in convert()
providers/providers.go Parse SignOutURL from config into ProviderData.SignOutURL
providers/sis.go Use redirect.Query() instead of url.Values{} to preserve existing query params
providers/sis_test.go Add TestSISProviderGetSignOutURL covering query param preservation

Usage

# env var
OAUTH2_PROXY_SIGN_OUT_URL: "https://autentica.redsara.es/Autentica/logout?appId=5784"

When set, after clearing the session cookie oauth2-proxy redirects the browser to this URL (preserving any existing query params) instead of <SIS_ROOT>/logout.

Test plan

  • Deploy with OAUTH2_PROXY_SIGN_OUT_URL unset → logout behaviour unchanged
  • Deploy with OAUTH2_PROXY_SIGN_OUT_URL=https://autentica.redsara.es/Autentica/logout?appId=5784 → browser redirects to Autentica on sign-out with appId param intact
  • go test ./providers/ -run TestSISProvider passes

Relates to: PLT-3581 (https://stratio.atlassian.net/browse/PLT-3581)

🤖 Generated with Claude Code

…OUT_URL

The flag was already registered but not wired to any struct. This connects
it so deployments can override the provider's default sign-out redirect URL
without changing the SIS root URL (needed for non-standard IdP logout flows
like Autentica).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@majimenez-stratio majimenez-stratio changed the title Add configurable sign-out URL via --sign-out-url / OAUTH2_PROXY_SIGN_OUT_URL [PLT-3581] Add configurable sign-out URL via --sign-out-url / OAUTH2_PROXY_SIGN_OUT_URL May 12, 2026
majimenez-stratio and others added 3 commits May 12, 2026 18:11
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
url.Values{} was overwriting SignOutURL's query string entirely,
dropping params like ?appId=5784 when adding the rd redirect.
Use redirect.Query() to merge instead.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant