[🐛 Bug]: OAuth2 Proxy logout leaves the Auth.js session active when switching users
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 73/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- authentication, frontend
Research direction
Start with keep-ui/shared/lib/hooks/useSignOut.ts at the linked v0.52.0 lines and trace how its OAuth2 Proxy branch handles Auth.js sign-out before redirecting. Reproduce the user-switch flow with AUTH_TYPE=OAUTH2PROXY, then verify that /api/auth/session identifies user B after signing out and back in.
Written by the indexing model from the issue text.
Description
Describe the bug
With AUTH_TYPE=OAUTH2PROXY, signing out of Keep and signing in as another user in the same browser can preserve the previous user's identity in Keep's frontend session. This was confirmed by inspecting /api/auth/session, so it is not only a stale username in the UI.
To check the /api/auth/session endpoint, this can be use the browser console:
fetch("/api/auth/session")
.then(r => r.json())
.then(s => console.log({
name: s.user?.name,
email: s.user?.email,
role: s.userRole
}));
To Reproduce
- Configure Keep with
AUTH_TYPE=OAUTH2PROXY, OAuth2 Proxy, and Keycloak as the identity provider. Configure the proxy'sbackend-logout-urlto log out of the identity provider. - Sign in as user A (admin).
- Sign out using Keep's UI.
- Sign in as user B (NOC) in the same browser, without clearing cookies or opening a fresh private window.
- Check the displayed username and inspect the response from
/api/auth/sessionin the browser's developer tools(console).
Actual behavior
Keep retains user A's frontend session identity after signing in as user B.
Expected behavior
Keep clears its internal Auth.js session before continuing with OAuth2 Proxy logout. After signing in as user B, the UI and /api/auth/session should identify user B.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
- The behavior was reproduced on Keep-ui
v0.52.0. - useSignOut.ts redirects directly to
/oauth2/sign_outand returns without calling Auth.jssignOut. - Making the callback async and adding
await signOut({ redirect: false })before assigningwindow.location.hreffixed the observed behavior onv0.52.0.
Related reports and changes:
- Dominant language
- Python
- Stars
- 12.4k
- Forks
- 1.5k
- Avg merge
- 20h 5m
- Merged PRs (30d)
- 1
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from keephq/keep
-
[🐛 Bug]: ARQ Worker fails to connect to password-protected Redis Sentinel (missing sentinel_kwargs)Possibly taken @Amandot claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
keephq/keep#6886 · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
keephq/keep#6803 · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
keephq/keep#6572 · 2 comments ·
Maintainers usually reply within 1 day
-
[Bug]: Google Chat delivery has no HTTP timeout and ignores transient retry boundariesPossibly taken @cayo-aura claimed this 2 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 57/100
keephq/keep#6885 · 1 reaction ·
Maintainers usually reply within 1 day
-
Topology dependency cross-tenant IDOR (unauthorized delete/rewrite of another tenant's data)Possibly taken @smartcalsystems-sketch claimed this 3 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 25/100
keephq/keep#6881 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
Similar issues
-
comp/tools P2 type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NousResearch/hermes-agent#142908 · 1 comment ·
-
[oblt-aw][autodoc] Fix malformed headings in new Buildkite docs pagesPossibly taken @github-actions claimed this today. Opendocumentation
Difficulty 1/5 Under an hour Newbie friendliness 83/100
Maintainers usually reply within 1 day
-
[Bug]: fileUploadMatrix.test.ts URL case does a real DNS lookup and fails offlinePossibly taken @r2jaff claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ComposioHQ/composio#5054 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
pytorch/tensordict#3286 ·
Maintainers usually reply within 1 day