feat(oidc): use worker queue for OIDC Back-Channel Logout notifications (#11441)

# Which Problems Are Solved

The current back-channel logout notification still used a single
projection handler for handling terminating sessions and notifying the
necessary clients. This can lead to back pressure and delayed
notifications.

# How the Problems Are Solved

The handler now only creates a job in the (river) worker queue to handle
the notification.
The worker will then search for all necessary clients to be informed and
create a job for each.
These jobs will then be picked up by the (same) worker(s) again, which
will create, sign and send the logout token to the client. If one
notification fails, this one job will be retired, but others can still
be processed in parallel and ore not affected.
Each successful job will still create an event on the session stating
the successful notification of the client.
The existing `OIDC.DefaultBackChannelLogoutLifetime` configuration has
been deprecated in favor of making it part of the new
`OIDC.BackChannelLogout` config.
 
# Additional Changes

None

# Additional Context

- feature check is still executed and will be removed seperately for
easier review: https://github.com/zitadel/zitadel/issues/11277
- closes https://github.com/zitadel/zitadel/issues/9279
- requires backport to v4.x
This commit is contained in:
Livio Spring
2026-02-03 10:47:48 +00:00
committed by GitHub
parent 09cf7cf0ae
commit d51d615e97
12 changed files with 780 additions and 117 deletions
+15 -1
View File
@@ -625,8 +625,22 @@ OIDC:
DefaultLogoutURLV2: "/ui/v2/login/logout?post_logout_redirect=" # ZITADEL_OIDC_DEFAULTLOGOUTURLV2
# Internal cache age for public keys to speed up validations (e.g. id_token_hints) on the authorization endpoint.
PublicKeyCacheMaxAge: 24h # ZITADEL_OIDC_PUBLICKEYCACHEMAXAGE
# Lifetime of the token used to notify clients through OIDC back-channel logout when the feature is enabled and registered on the client.
# Lifetime of the token used to notify clients through OIDC back-channel logout.
# Deprecated: use BackChannelLogout.TokenLifetime instead
DefaultBackChannelLogoutLifetime: 15m # ZITADEL_OIDC_DEFAULTBACKCHANNELLOGOUTLIFETIME
BackChannelLogout:
# The amount of workers processing the back-channel logout notifications.
# If set to 0, no notifications will be handled. This can be useful when running in
# multi binary / pod setup and allowing only certain executables to process the events.
Workers: 1 # ZITADEL_OIDC_BACKCHANNELLOGOUT_WORKERS
# The maximum duration a job can do it's work before it is considered as failed.
TransactionDuration: 10s # ZITADEL_OIDC_BACKCHANNELLOGOUT_TRANSACTIONDURATION
# Automatically cancel the notification after the amount of failed attempts
MaxAttempts: 3 # ZITADEL_OIDC_BACKCHANNELLOGOUT_MAXATTEMPTS
# Automatically cancel the notification if it cannot be handled within a specific time
MaxTtl: 5m # ZITADEL_OIDC_BACKCHANNELLOGOUT_MAXTTL
# Lifetime of the token used to notify clients through OIDC back-channel logout.
TokenLifetime: 15m # ZITADEL_OIDC_BACKCHANNELLOGOUT_TOKENLIFETIME
SAML:
DefaultLoginURLV2: "/ui/v2/login/login?samlRequest=" # ZITADEL_SAML_DEFAULTLOGINURLV2
+1 -2
View File
@@ -216,6 +216,7 @@ func projections(
config.Projections.Customizations["backchannel"],
config.Projections.Customizations["telemetry"],
config.Notifications,
config.OIDC.BackChannelLogoutConfig(),
*config.Telemetry,
config.ExternalDomain,
config.ExternalPort,
@@ -228,8 +229,6 @@ func projections(
keys.User,
keys.SMTP,
keys.SMS,
keys.OIDC,
config.OIDC.DefaultBackChannelLogoutLifetime,
nil,
)
+1 -2
View File
@@ -589,6 +589,7 @@ func startCommandsQueries(
config.Projections.Customizations["backchannel"],
config.Projections.Customizations["telemetry"],
config.Notifications,
config.OIDC.BackChannelLogoutConfig(),
*config.Telemetry,
config.ExternalDomain,
config.ExternalPort,
@@ -601,8 +602,6 @@ func startCommandsQueries(
keys.User,
keys.SMTP,
keys.SMS,
keys.OIDC,
config.OIDC.DefaultBackChannelLogoutLifetime,
q,
)
+1 -2
View File
@@ -324,6 +324,7 @@ func startZitadel(ctx context.Context, config *Config, masterKey string, server
config.Projections.Customizations["backchannel"],
config.Projections.Customizations["telemetry"],
config.Notifications,
config.OIDC.BackChannelLogoutConfig(),
*config.Telemetry,
config.ExternalDomain,
config.ExternalPort,
@@ -336,8 +337,6 @@ func startZitadel(ctx context.Context, config *Config, masterKey string, server
keys.User,
keys.SMTP,
keys.SMS,
keys.OIDC,
config.OIDC.DefaultBackChannelLogoutLifetime,
q,
)
notification.Start(ctx)