Add OpenID Connect back-channel logout #79

Merged
calvin merged 4 commits from oidc-backchannel-logout into master 2026-11-14 21:38:26 +00:00
Owner

The identity provider can now tell Salt that a person was signed out or disabled. POST /auth/oidc/backchannel-logout ends every session of the person with that sub and disconnects their open pages.

  • No browser pipeline: no session, no CSRF token. The signed logout token is the proof.
  • Signature: :oidcc_jwt_util.verify_signature/3, the code oidcc uses for ID tokens. It walks a JWK set and prefers the key named by kid. Algorithms are the provider's id_token_signing_alg_values_supported, never none.
  • Claims: iss, aud, iat (not future, not older than 5 minutes), exp when present, events member, no nonce, sub, jti.
  • 200 (also unknown sub), 400 JSON error, 404 OIDC off, 429 per address, 503 when the provider keys are not loaded.
  • jti is not remembered. A replay only signs the same person out again.
  • Sid-only tokens are refused.
  • Mock provider now publishes two keys.

Tests: the DB-free tests run locally. Tests tagged :integration need the database (CI): valid token ends only that user, no exp/kid variants, second key, unknown sub 200, refused token ends nothing.

Not seen working against a real identity provider.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DnYzaTxC2GmdSpvCNyHNne

The identity provider can now tell Salt that a person was signed out or disabled. `POST /auth/oidc/backchannel-logout` ends every session of the person with that `sub` and disconnects their open pages. - No browser pipeline: no session, no CSRF token. The signed logout token is the proof. - Signature: `:oidcc_jwt_util.verify_signature/3`, the code oidcc uses for ID tokens. It walks a JWK set and prefers the key named by `kid`. Algorithms are the provider's `id_token_signing_alg_values_supported`, never `none`. - Claims: iss, aud, iat (not future, not older than 5 minutes), exp when present, events member, no nonce, sub, jti. - 200 (also unknown sub), 400 JSON error, 404 OIDC off, 429 per address, 503 when the provider keys are not loaded. - `jti` is not remembered. A replay only signs the same person out again. - Sid-only tokens are refused. - Mock provider now publishes two keys. Tests: the DB-free tests run locally. Tests tagged `:integration` need the database (CI): valid token ends only that user, no exp/kid variants, second key, unknown sub 200, refused token ends nothing. Not seen working against a real identity provider. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01DnYzaTxC2GmdSpvCNyHNne
Add OpenID Connect back-channel logout
Some checks failed
ci/woodpecker/pr/image Pipeline was successful
ci/woodpecker/pr/quality Pipeline was successful
ci/woodpecker/pr/integration Pipeline was canceled
c503ad9d44
POST /auth/oidc/backchannel-logout ends all sessions of the person named by
the logout token's sub. The token is checked with oidcc's own key-set and
algorithm code. Unknown sub is 200, refusals 400, no keys loaded 503, OIDC off
404, rate limited per address.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DnYzaTxC2GmdSpvCNyHNne
Back-channel logout: review fixes
Some checks failed
ci/woodpecker/pr/quality Pipeline failed
ci/woodpecker/pr/integration unknown status
ci/woodpecker/pr/image Pipeline was successful
abbd5511ac
Misconfiguration (no algorithms, no keys, unexpected errors) is 503, not 400.
Only the known malformed-token errors are a bad token. An unknown kid reloads
the keys once a minute at most and checks again. Only refused tokens count
against the rate limit. iat may be an hour old.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DnYzaTxC2GmdSpvCNyHNne
Back-channel logout: credo fixes, 503 while the key reload is used up
Some checks failed
ci/woodpecker/pr/image Pipeline was successful
ci/woodpecker/pr/quality Pipeline was successful
ci/woodpecker/pr/integration Pipeline failed
68be603698
Flatten retry_with_fresh_keys, alias the worker in the test. A token for a
rotated key that arrives while the once-a-minute reload is used up now gets 503
so the provider retries, not 400.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DnYzaTxC2GmdSpvCNyHNne
Test: read the info line at info level
All checks were successful
ci/woodpecker/pr/image Pipeline was successful
ci/woodpecker/pr/quality Pipeline was successful
ci/woodpecker/pr/integration Pipeline was successful
481a66e4a8
The suite logs at warning, so the line this database test looks for was
never captured in CI. The behaviour it checks (that person's sessions end,
another person's stay) passed.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DnYzaTxC2GmdSpvCNyHNne
calvin merged commit f4585d3a32 into master 2026-11-14 21:38:26 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
external/salt-dns!79
No description provided.