diff --git a/model/jpa/src/main/resources/META-INF/jpa-changelog-2.1.0.xml b/model/jpa/src/main/resources/META-INF/jpa-changelog-2.1.0.xml new file mode 100755 index 0000000000..79ba2fc3d1 --- /dev/null +++ b/model/jpa/src/main/resources/META-INF/jpa-changelog-2.1.0.xml @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + TYPE in ('password-history', 'password') AND ALGORITHM is NULL + + + + + + + + + + TYPE in ('password-history', 'password') AND ALGORITHM = 'HmacSHA1' + + + + + + + + + + \ No newline at end of file diff --git a/services/src/main/java/org/keycloak/authorization/admin/ResourceServerService.java b/services/src/main/java/org/keycloak/authorization/admin/ResourceServerService.java index 84e52954c3..4f1e638c09 100644 --- a/services/src/main/java/org/keycloak/authorization/admin/ResourceServerService.java +++ b/services/src/main/java/org/keycloak/authorization/admin/ResourceServerService.java @@ -500,7 +500,7 @@ public class ResourceServerService { umaProtectionRole = client.addRole(Constants.AUTHZ_UMA_PROTECTION); } - UserModel serviceAccount = this.session.users().getUserByServiceAccountClient(client); + UserModel serviceAccount = this.session.users().getServiceAccount(client); if (!serviceAccount.hasRole(umaProtectionRole)) { serviceAccount.grantRole(umaProtectionRole); diff --git a/services/src/main/java/org/keycloak/authorization/common/KeycloakIdentity.java b/services/src/main/java/org/keycloak/authorization/common/KeycloakIdentity.java index 922785423e..5ddd431279 100644 --- a/services/src/main/java/org/keycloak/authorization/common/KeycloakIdentity.java +++ b/services/src/main/java/org/keycloak/authorization/common/KeycloakIdentity.java @@ -139,10 +139,10 @@ public class KeycloakIdentity implements Identity { if (this.accessToken.getClientSession() != null) { ClientSessionModel clientSession = this.keycloakSession.sessions().getClientSession(this.accessToken.getClientSession()); - clientUser = this.keycloakSession.users().getUserByServiceAccountClient(clientSession.getClient()); + clientUser = this.keycloakSession.users().getServiceAccount(clientSession.getClient()); } else if (this.accessToken.getIssuedFor() != null) { ClientModel clientModel = this.keycloakSession.realms().getClientById(this.accessToken.getIssuedFor(), this.realm); - clientUser = this.keycloakSession.users().getUserByServiceAccountClient(clientModel); + clientUser = this.keycloakSession.users().getServiceAccount(clientModel); } diff --git a/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/rest/TestingResourceProvider.java b/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/rest/TestingResourceProvider.java index e484645326..bbc9f276ae 100644 --- a/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/rest/TestingResourceProvider.java +++ b/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/rest/TestingResourceProvider.java @@ -635,7 +635,7 @@ public class TestingResourceProvider implements RealmResourceProvider { public UserRepresentation getUserByServiceAccountClient(@QueryParam("realmName") String realmName, @QueryParam("clientId") String clientId) { RealmModel realm = getRealmByName(realmName); ClientModel client = realm.getClientByClientId(clientId); - UserModel user = session.users().getUserByServiceAccountClient(client); + UserModel user = session.users().getServiceAccount(client); if (user == null) return null; return ModelToRepresentation.toRepresentation(user); }