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

Show indicator for transient user in user sessions list in admin ui #28882

Conversation

thomasdarimont
Copy link
Contributor

@thomasdarimont thomasdarimont commented Apr 18, 2024

This PR adds a transient user indicator to the user sessions listing.

  • For transient users a transient label is now shown in the session list in the admin ui
  • this adds a new boolean property transientUser to org.keycloak.admin.ui.rest.model.SessionRepresentation

Fixes #28879

With this PR applied the UI looks like this:
image

Perhaps there could be a bit more spacing between the label and the username.

@thomasdarimont thomasdarimont force-pushed the issue/GH-28879-show-transient-userlabel-in-sessions-list branch from 4f44052 to 072e81f Compare April 18, 2024 10:18
@thomasdarimont thomasdarimont marked this pull request as ready for review April 18, 2024 10:18
@thomasdarimont thomasdarimont requested a review from a team as a code owner April 18, 2024 10:18
@hmlnarik hmlnarik self-assigned this Apr 18, 2024
Copy link
Contributor

@hmlnarik hmlnarik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR!

The sessions now display the transientness of users in the main realm Sessions view, but it is not displayed for sessions displayed from a client's Sessions tab. A similar change to the one in the SessionsResource from this PR is needed in ClientResource.

js/apps/admin-ui/src/sessions/SessionsTable.tsx Outdated Show resolved Hide resolved
@ahus1 ahus1 changed the title Show indicator for transient user in user sessions list in admin ui (#28879) Show indicator for transient user in user sessions list in admin ui Apr 18, 2024
@thomasdarimont thomasdarimont force-pushed the issue/GH-28879-show-transient-userlabel-in-sessions-list branch 2 times, most recently from 59054d9 to 1544dec Compare April 18, 2024 16:24
@thomasdarimont thomasdarimont requested a review from a team as a code owner April 18, 2024 16:24
@thomasdarimont
Copy link
Contributor Author

thomasdarimont commented Apr 18, 2024

Thanks @hmlnarik for the review!
I had to adapt org.keycloak.representations.idm.UserSessionRepresentation and org.keycloak.models.utils.ModelToRepresentation#toRepresentation(org.keycloak.models.UserSessionModel)

It now looks like that:

Realm Sessions View:
image

Client Sessions View:
image

@thomasdarimont thomasdarimont force-pushed the issue/GH-28879-show-transient-userlabel-in-sessions-list branch from 1544dec to 9477945 Compare April 18, 2024 16:26
…28879)

For transient users a transient label is now shown in the realm sessions and client sessions list in the admin ui.

Fixes keycloak#28879

Co-authored-by: Thomas Darimont <thomas.darimont@googlemail.com>
Co-authored-by: Hynek Mlnařík <hmlnarik@users.noreply.github.com>
Signed-off-by: Thomas Darimont <thomas.darimont@googlemail.com>
@thomasdarimont thomasdarimont force-pushed the issue/GH-28879-show-transient-userlabel-in-sessions-list branch from 9477945 to 0c602df Compare April 18, 2024 19:02
Copy link
Contributor

@hmlnarik hmlnarik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update @thomasdarimont!

The clients_saml_test.spec.ts failure is not caused by this PR, thus merging.

@hmlnarik hmlnarik merged commit 6861718 into keycloak:main Apr 19, 2024
67 of 69 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Indicate whether a user is transient or not in user sessions list
2 participants