firstly i'd Like to apologise for typos, writing thing on a tablet pc on a plain.
I'm building a springboot app secured by a Keycloak service. I need my end-user to be able to create an keycloak User via my Frontend so I've tried to build it via the keycloak admin dependency
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-admin-client</artifactId>
<version>11.0.2</version>
</dependency>
I'm almost done but getting a nasty HTTP 409
on
private void createClientRole(String clientRole, Keycloak kc) {
RoleRepresentation clientRoleRepresentation = new RoleRepresentation();
clientRoleRepresentation.setName(clientRole);
clientRoleRepresentation.setClientRole(true);
kc.realm(this.realm).clients().findByClientId(clientId).forEach(clientRepresentation ->
kc.realm(this.realm).clients().get(clientRepresentation.getId()).roles().create(clientRoleRepresentation)
);//<== Here
}
There is no further explanation, don't know what's happening there. Any idea?
Kind regards, Rosario