Get memberof list via REST API

How can I get the groups a user belongs (usually referred to as memberof) though the keycloak REST API? Thanks!

https://www.keycloak.org/docs-api/5.0/rest-api/index.html#_getuser
This method returns the UserRepresentation, which includes the groups.

https://www.keycloak.org/docs-api/5.0/rest-api/index.html#_groupmembership
This method returns an array of GroupRepresentations for a given user.

1 Like