keycloak/keycloak

Deletion of users imported via user storage federation leaves dangling offline user and client sessions

开放

#20,170 创建于 2023年5月4日

 (8 条评论) (3 个反应) (0 位负责人)Java (8,346 个派生)batch import
area/storagehelp wantedkind/bugpriority/normalstatus/auto-bumpteam/core-iam

仓库指标

星标
 (34,398 个星标)
PR 合并指标
 (平均合并 6天 19小时) (30 天内合并 384 个 PR)

描述

Before reporting an issue

  • I have searched existing issues
  • I have reproduced the issue with the latest release

Area

storage

Describe the bug

Removing users imported by a user storage provider via the "remove imported" action in the admin ui, does not clean up existing offline user sessions and offline client sessions. The many orphaned entries unnecessarily occupy a lot of storage, lead to large backups and can slow down the index maintenance.

Version

21.1.1

Expected behavior

Offline user sessions and associated offline client sessions should also be removed if a federated user is deleted via the "remove imported" action.

Actual behavior

Offline user and client sessions are NOT removed when a federated user is deleted via "remove imported" action.

How to Reproduce?

  1. Import a user via user storage federation
  2. create a client that supports offline_access
  3. create an offline_session for the user for the client
  4. look at the database tables offline_user_Session and offline_client_session and look for the user offline session for the given client
  5. For the user storage provider execute the "remove imported" action
  6. look at the database tables again, the session from before are still there, but there is no user anymore.

Anything else?

No response

贡献者指南