[keycloak-user] Unable to get list of client level roles - available roles

Stian Thorgersen sthorger at redhat.com
Fri Sep 30 03:57:54 EDT 2016


Default roles returns the roles of the client that are added to new users
by default, not the available client roles. To see roles do:

getRealm().clients().getClient(clientRepresentation.getId()).roles().list()

On 27 September 2016 at 10:56, Jitendra Chouhan <jitendrachouhan03 at gmail.com
> wrote:

> Hi,
>
> I am not able to get client level available roles in keycloak using
> keycloak-admin-client.jar. Please find sample code i am using to get client
> and then thought of getting available roles under a client.
>
> ClientsResource clientsResource = getRealm().clients();
> ClientRepresentation> clientsRepresentation =
> clientsResource.findByClientId(appName);
> clientRepresentation = clientsRepresentation.get(0);
> clientRepresentation.getDefaultRoles();
>
> With above code i am only getting default roles under a client but not all
> available roles as there is no method available in ClientResource class.
>
> Thanks,
> Jitendra Chouhan
>
>
> _______________________________________________
> keycloak-user mailing list
> keycloak-user at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-user
>


More information about the keycloak-user mailing list