mirror of
https://github.com/keycloak/keycloak.git
synced 2026-01-09 23:12:06 -03:30
Set clientId if it is not set in the entity
Closes #32195 Signed-off-by: Michal Hajas <mhajas@redhat.com> (cherry picked from commit 6a9245546e92a05c00410a8d7ac5897f3261a116)
This commit is contained in:
parent
9bd5075caa
commit
db95afd73c
@ -1017,9 +1017,13 @@ public class PersistentUserSessionProvider implements UserSessionProvider, Sessi
|
||||
// ignoring old and unknown realm found in the session
|
||||
return;
|
||||
}
|
||||
sessionEntityWrapper.getEntity().getAuthenticatedClientSessions().forEach((k, uuid) -> {
|
||||
sessionEntityWrapper.getEntity().getAuthenticatedClientSessions().forEach((clientId, uuid) -> {
|
||||
SessionEntityWrapper<AuthenticatedClientSessionEntity> clientSession = clientSessionCache.get(uuid);
|
||||
if (clientSession != null) {
|
||||
// This is necessary because client sessions created by a KC version < 22 do not have clientId set within the entity.
|
||||
if (clientSession.getEntity().getClientId() == null) {
|
||||
clientSession.getEntity().setClientId(clientId);
|
||||
}
|
||||
clientSession.getEntity().setUserSessionId(sessionEntityWrapper.getEntity().getId());
|
||||
MergedUpdate<AuthenticatedClientSessionEntity> merged = MergedUpdate.computeUpdate(Collections.singletonList(Tasks.addIfAbsentSync()), clientSession, 1, 1);
|
||||
clientSessionPerformer.registerChange(Map.entry(uuid, new SessionUpdatesList<>(realm, clientSession)), merged);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user