Keycloak 11.0.2 rest api/ rest client

How to create role based policy using keycloak authorization java client. We found only uma based policy creation api. Even there is no rest api url endpoint found for the same. Please help.

The API is not fully documented on their website. Your better of taking a look at the source code of the Keycloak admin client resources under https://github.com/keycloak/keycloak/tree/master/integration/admin-client/src/main/java/org/keycloak/admin/client/resource and see what’s available

1 Like

Hi Zonaut,

Thanks for the response and really appreciate your help. But the problem I am facing now is :

RolePoliciesResource rolePoliciesResource = clientResource.authorization().policies().role();

Response response = rolePoliciesResource.create(rolePolicyRepresentation); // it is givivng 404 error for keycloak version 11.0.2

After checking the URL it is trying to hit is:
/auth/admin/realms/test/clients/road-vdb-client/authz/resource-server/policy/role

looks like the above endpoint is not available in keycloak 11.0.2