oauth2-proxy/pkg/apis/options
Antonio Aranda Hernández 3f470b6234 feat: add OIDC back-channel logout support
Implements https://openid.net/specs/openid-connect-backchannel-1_0.html

When --oidc-backchannel-logout is set (requires --session-store-type=redis),
the proxy exposes POST /oauth2/backchannel-logout. The OIDC provider (e.g.
Keycloak, Azure AD) can POST a signed logout_token to instantly revoke a
user's session server-side without a browser redirect.

Changes:
- oauthproxy.go: BackChannelLogout handler; route registered only when the
  flag is set; validates logout_token JWT per spec §2.4 (nonce absence,
  backchannel-logout event, sid claim)
- pkg/apis/sessions/interfaces.go: BackChannelSessionStore interface with
  ClearBySID(ctx, sessionID) error
- pkg/apis/sessions/session_state.go: SessionID field (sid OIDC claim)
- pkg/sessions/persistence/manager.go: ClearBySID implementation and a
  secondary sid→ticketID index written on every Save
- pkg/sessions/persistence/manager_test.go: unit tests for ClearBySID
- pkg/sessions/tests/mock_store.go: CacheSize() helper for tests
- providers/provider_data.go: BackChannelLogoutSupported field
- providers/provider_data.go: extracts sid claim into SessionState on login
- providers/providers.go: wires oidcConfig.backChannelLogoutEnabled
- pkg/apis/options/providers.go: BackChannelLogoutEnabled option
- pkg/apis/options/legacy_options.go: --oidc-backchannel-logout flag
- oauthproxy_test.go: unit tests for the BackChannelLogout handler
- docs: back-channel logout section in keycloak_oidc.md and openid_connect.md

Signed-off-by: Antonio Aranda Hernández <aaranda@hortichuelas.es>
2026-06-23 08:41:12 +02:00
..
testutil chore(deps): Updated to ginkgo v2 (#2459) 2024-07-18 22:41:02 +02:00
util revert: secrets as []byte instead of string 2025-11-16 22:38:42 +01:00
alpha_options.go feat: add ensure defaults to all migrated structs 2025-11-16 22:38:52 +01:00
app.go Allow specifying URL as input for custom sign in logo (#1330) 2021-09-05 09:23:22 -07:00
cookie.go feat: add same site option for csrf cookies (#3347) 2026-03-18 23:14:36 +08:00
cookie_test.go feat(cookie): add feature support for cookie-secret-file (#3104) 2025-07-22 18:59:55 +02:00
doc.go fix alpha config 2025-11-16 22:38:40 +01:00
header.go feat: migrate google used organization id and header normalization booleans to pointers 2025-11-16 22:39:01 +01:00
hooks.go fix merge problems and test cases 2025-11-16 22:38:44 +01:00
hooks_test.go fix merge problems and test cases 2025-11-16 22:38:44 +01:00
legacy_options.go feat: add OIDC back-channel logout support 2026-06-23 08:41:12 +02:00
legacy_options_test.go feat: add support for specifying allowed OIDC JWT signing algorithms (#2753) (#2851) 2026-03-18 22:24:27 +08:00
load.go chore(goconsts): use proper constants for http methods 2026-06-08 12:54:58 +02:00
load_test.go chore(deps): update gomod dependencies (#3411) 2026-04-12 14:21:47 +02:00
logging.go feat: readiness check (#1839) 2022-12-23 09:08:12 +00:00
login_url_parameters.go use official upstream yaml library v3 2025-11-16 22:38:22 +01:00
options.go Merge commit from fork 2026-04-13 18:22:56 +02:00
options_suite_test.go chore(deps): Updated to ginkgo v2 (#2459) 2024-07-18 22:41:02 +02:00
providers.go feat: add OIDC back-channel logout support 2026-06-23 08:41:12 +02:00
secret_source.go feat: add ensure defaults to all migrated structs 2025-11-16 22:38:52 +01:00
server.go feat: add support for setting a unix binding's socket file mode (#3376) 2026-03-19 00:08:50 +08:00
sessions.go Add ability to configure username for Redis cluster connections (#2381) 2024-01-20 20:00:02 +00:00
upstreams.go fix: static upstreams failing validation due to `passHostHeader` and `proxyWebSockets` defaults being set incorrectly (#3302) 2026-01-17 15:15:19 +01:00