I’m having some trouble to use keycloak-admin-client in spring boot.
If I try with this code I get 401 (unauthorized):
public Keycloak getKeycloakInstance() {
var keycloak = KeycloakBuilder.builder()
.serverUrl(SERVER_URL)
.realm(REALM)
.username(USERNAME)
.password(PASSWORD)
.clientId(CLIENT_ID)
.build();
return keycloak;
}
Also, if I put .resteasyClient(....) and .clientSecret(...) in the code above i get badrequest.
In the client roles I created a new composite role and gave all realm-management roles to it, maybe I configured something wrong?
Where can I find some documentation on how to use this Admin Client Dependency?
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-admin-client</artifactId>
<version>10.0.0</version>
</dependency>