Search in sources :

Example 1 with ProfileInfoRepresentation

use of org.keycloak.representations.info.ProfileInfoRepresentation in project keycloak by keycloak.

the class ProfileAssume method updateProfile.

private static void updateProfile() {
    String host = System.getProperty("auth.server.host", "localhost");
    String port = System.getProperty("auth.server.http.port", "8180");
    boolean adapterCompatTesting = Boolean.parseBoolean(System.getProperty("testsuite.adapter.compat.testing"));
    String authServerContextRoot = "http://" + host + ":" + port;
    try (Keycloak adminClient = AdminClientUtil.createAdminClient(adapterCompatTesting, authServerContextRoot)) {
        ProfileInfoRepresentation profileInfo = adminClient.serverInfo().getInfo().getProfileInfo();
        profile = profileInfo.getName();
        List<String> disabled = profileInfo.getDisabledFeatures();
        disabledFeatures = Collections.unmodifiableSet(new HashSet<>(disabled));
    } catch (Exception e) {
        throw new RuntimeException("Failed to obtain profile / features info from serverinfo endpoint of " + authServerContextRoot, e);
    }
}
Also used : ProfileInfoRepresentation(org.keycloak.representations.info.ProfileInfoRepresentation) Keycloak(org.keycloak.admin.client.Keycloak) HashSet(java.util.HashSet)

Aggregations

HashSet (java.util.HashSet)1 Keycloak (org.keycloak.admin.client.Keycloak)1 ProfileInfoRepresentation (org.keycloak.representations.info.ProfileInfoRepresentation)1