KEYCLOAK-17678 Fix getting client scope by name resulting in listing clients

This commit is contained in:
stianst 2021-04-07 16:39:03 +02:00 committed by Stian Thorgersen
parent 5a9068e732
commit a09142c43a

View file

@ -714,10 +714,7 @@ public final class KeycloakModelUtils {
.filter(clientScope -> Objects.equals(clientScopeName, clientScope.getName()))
.findFirst()
// check if we are referencing a client instead of a scope
.orElse(realm.getClientsStream()
.filter(c -> Objects.equals(clientScopeName, c.getClientId()))
.findFirst()
.orElse(null));
.orElseGet(() -> realm.getClientByClientId(clientScopeName));
}
/**