Skip to content

Commit

Permalink
Fix pre-26 clients attributes when created client-secret.
Browse files Browse the repository at this point in the history
  • Loading branch information
ma1uta committed Nov 14, 2024
1 parent f93f7ef commit 23ba5d1
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
import static org.hamcrest.Matchers.emptyString;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasEntry;
import static org.hamcrest.Matchers.hasKey;
import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.matchesPattern;
import static org.hamcrest.Matchers.not;
Expand Down Expand Up @@ -1993,7 +1994,12 @@ void shouldRemoveAuthzPoliciesForRealmManagement() throws IOException {
assertThat(client.getDefaultClientScopes(), containsInAnyOrder("web-origins", "profile", "roles", "email"));
assertThat(client.getOptionalClientScopes(), containsInAnyOrder("address", "phone", "offline_access", "microprofile-jwt"));

checkClientAttributes(client);
if (VersionUtil.lt(KEYCLOAK_VERSION, "26")) {
assertThat(client.getAttributes(), hasKey("client.secret.creation.time"));
} else {
// https://github.com/keycloak/keycloak/pull/30433 Added attribute to recognize realm client
assertThat(client.getAttributes(), hasEntry("realm_client", "true"));
}

ResourceServerRepresentation authorizationSettings = client.getAuthorizationSettings();
assertThat(authorizationSettings.isAllowRemoteResourceManagement(), is(false));
Expand Down

0 comments on commit 23ba5d1

Please sign in to comment.