KEYCLOAK-19286 Use client storage provider id to construct client StorageId, so that a valid 'external' client id will be generated.

This commit is contained in:
Luca Graf 2021-09-13 15:14:59 +02:00 committed by Hynek Mlnařík
parent d562bea54e
commit 2c22ccbf97

View file

@ -434,7 +434,7 @@ public class JpaUserSessionPersisterProvider implements UserSessionPersisterProv
private PersistentAuthenticatedClientSessionAdapter toAdapter(RealmModel realm, PersistentUserSessionAdapter userSession, PersistentClientSessionEntity entity) {
String clientId = entity.getClientId();
if (!entity.getExternalClientId().equals("local")) {
clientId = new StorageId(entity.getClientId(), entity.getExternalClientId()).getId();
clientId = new StorageId(entity.getClientStorageProvider(), entity.getExternalClientId()).getId();
}
ClientModel client = realm.getClientById(clientId);