Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close session when client is closed #111

Open
mario-s opened this issue Nov 22, 2024 · 0 comments
Open

Close session when client is closed #111

mario-s opened this issue Nov 22, 2024 · 0 comments
Labels
area/admin-client kind/enhancement priority/important Must be worked on very soon status/fix-in-keycloak-required Refers to the issue, which need fix in keycloak/keycloak and will be synced to keycloak-client later team/core-clients

Comments

@mario-s
Copy link

mario-s commented Nov 22, 2024

Description

When I use the admin client in a Quarkus application, like in this tutorial and call the endpoint of the REST resource several times, the number of sessions increase with every request. This also happens when using the client in a try-with-resources block.

But the session is properly closed when executing tokenManager().logout();.

Note that there is already an issue in the Keycloak repository.

Discussion

No response

Motivation

Automatically cleanup every session when the close method of the client is used.

Details

I could provide a PR in the Keycloak repository for this issue. The change is small:

@Override
public void close() {
  if (this.tokenManager != null) {
    this.tokenManager.logout();
  }
  closed = true;
  client.close();
}
@mposolda mposolda added kind/enhancement help wanted Extra attention is needed area/admin-client team/core-clients priority/important Must be worked on very soon status/fix-in-keycloak-required Refers to the issue, which need fix in keycloak/keycloak and will be synced to keycloak-client later and removed kind/enhancement help wanted Extra attention is needed labels Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/admin-client kind/enhancement priority/important Must be worked on very soon status/fix-in-keycloak-required Refers to the issue, which need fix in keycloak/keycloak and will be synced to keycloak-client later team/core-clients
Projects
None yet
Development

No branches or pull requests

2 participants