通过Rest API删除客户端

时间:2020-08-04 10:29:24

标签: keycloak

我正在使用:

 <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删除客户端?还是故意缺少此选项?

1 个答案:

答案 0 :(得分:2)

基于docs,有这样的API:DELETE /{realm}/clients/{id}

keycloak.realm("realm").clients().get("id").remove();