我正在使用:
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-admin-client</artifactId>
<version>11.0.0</version>
</dependency>
我想以编程方式删除客户端。
很不幸,我看到ClientsResource
中的keycloak.realm("my-realm").clients()
只有创建选项:
@POST
@Consumes(MediaType.APPLICATION_JSON)
Response create(ClientRepresentation clientRepresentation);
是否可以使用REST API删除客户端?还是故意缺少此选项?
答案 0 :(得分:2)
基于docs,有这样的API:DELETE /{realm}/clients/{id}
。
keycloak.realm("realm").clients().get("id").remove();