Skip to content

Comments

fix: backchannel logout react to session ID (simpler approach)#1

Open
michaelstingl wants to merge 1 commit intomainfrom
fix/backchannel-logout-session-id
Open

fix: backchannel logout react to session ID (simpler approach)#1
michaelstingl wants to merge 1 commit intomainfrom
fix/backchannel-logout-session-id

Conversation

@michaelstingl
Copy link
Owner

Summary

Alternative, simpler approach to opencloud-eu/web#1969 for backchannel logout session ID matching.

Key difference: Instead of threading sessionId through the updateContext() / signInCallback() call chain (which forces signature changes across 13 files), this reads the session ID directly from the OIDC user profile inside UserManager.

Comparison

PR opencloud-eu#1969 This approach
Changed files 13 9
Additions / Deletions 69 / 22 39 / 4
updateContext signature Changed (breaking) Unchanged
signInCallback signature Changed Unchanged
Embed API (postMessage) Breaking change Unchanged
accesssToken typo bug Yes (line 384) N/A
Dead code (getSessionId()) Yes (never called) None

How it works

  1. UserManager.updateContext() reads user.profile.sid from the stored OIDC user internally — no parameter needed
  2. Session ID is stored in the authStore (Pinia)
  3. SSE backchannel logout handler compares event sessionid against stored session
  4. No sessionid in event → log out all clients (per OIDC Back-Channel Logout spec)
  5. Matching sessionid → log out this client only

Files changed

  • auth.ts — Add sessionId state to Pinia auth store
  • userManager.ts — Read sid from OIDC profile internally (no signature change)
  • types.ts — Add sessionid to SSE event schema, AuthStore to SSE options
  • common.ts — Backchannel logout logic (session ID comparison)
  • bootstrap.ts + index.ts — Pass authStore to SSE event listeners
  • 3 test files — Add authStore to test mocks

Issues found in PR opencloud-eu#1969

  1. Typo bug: event.data.accesssToken (3× "s") in authService.ts:384 — would be undefined at runtime
  2. Dead code: getSessionId() method added to UserManager but never called
  3. Breaking embed API: handleDelegatedTokenUpdate changes event.data from string to object

🤖 Generated with Claude Code

Read session ID from OIDC user profile internally in UserManager
instead of threading it through updateContext/signInCallback call
chain. This avoids signature changes, keeps the embed API stable,
and reduces the change surface.

The SSE backchannel logout handler now compares the event's session
ID against the stored session to only log out the affected client,
per the OIDC Back-Channel Logout spec.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link

Label error. Requires at least 1 of: Type:Bug, Type:Enhancement, Type:Feature, Type:Breaking-Change, Type:Test, Type:Documentation, Type:Maintenance, Type:Security, Type:Dependencies, Type:DevOps, dependencies. Found:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant