Prevent service account lookup when feature is disabled on client (#9579)

Closes #9563
This commit is contained in:
Guus der Kinderen 2022-04-26 09:12:46 +02:00 committed by GitHub
parent 5248815091
commit 8d3a4803bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -150,7 +150,7 @@ public class KeycloakIdentity implements Identity {
ClientModel clientModel = getTargetClient();
UserModel clientUser = null;
if (clientModel != null) {
if (clientModel != null && clientModel.isServiceAccountsEnabled()) {
clientUser = this.keycloakSession.users().getServiceAccount(clientModel);
}
@ -225,7 +225,7 @@ public class KeycloakIdentity implements Identity {
ClientModel clientModel = getTargetClient();
UserModel clientUser = null;
if (clientModel != null) {
if (clientModel != null && clientModel.isServiceAccountsEnabled()) {
clientUser = this.keycloakSession.users().getServiceAccount(clientModel);
}