[keycloak-user] In which cases will the return value of org.keycloak.representations.idm.GroupRepresentation.getAttributes() NOT empty?

Schenk, Manfred Manfred.Schenk at iosb.fraunhofer.de
Tue Apr 17 03:27:12 EDT 2018


Thanks for your answer. I wonder how one can implement such a logic without mentioning it in the documentation…

But with your hint I can get the desired attributes now.

Regards,
Manfred

--
Manfred Schenk, Fraunhofer IOSB
Informationsmanagement und Leittechnik
Fraunhoferstraße 1,76131 Karlsruhe, Germany
Telefon +49 721 6091-391
mailto:Manfred.Schenk at iosb.fraunhofer.de
http://www.iosb.fraunhofer.de

Von: Nhut Thai Le <ntle at castortech.com>
Gesendet: Montag, 16. April 2018 22:18
An: Schenk, Manfred <Manfred.Schenk at iosb.fraunhofer.de>
Cc: keycloak-user at lists.jboss.org
Betreff: Re: [keycloak-user] In which cases will the return value of org.keycloak.representations.idm.GroupRepresentation.getAttributes() NOT empty?

I had similar problem and i think most case when loading *Represenation from ID return more detail than a search or list method:

List<GroupRepresentation> groups = realm.groups().groups("sales", 0, 10);                                //search, returned items doesn't have attrs
GroupRepresentation g = groups.get(0);

Map<String, List<String>> attrs = new HashMap<String, List<String>>();                                              //just add my attr
attrs.put("_peaka", Collections.singletonList("boo"));
g.setAttributes(attrs);
realm.groups().group(g.getId()).update(g);

GroupRepresentation g1 = realm.groups().group(g.getId()).toRepresentation();    //loading group from its ID somehow load attrs

Thai

On Mon, Apr 16, 2018 at 10:32 AM, Schenk, Manfred <Manfred.Schenk at iosb.fraunhofer.de<mailto:Manfred.Schenk at iosb.fraunhofer.de>> wrote:
At the moment I'm trying to read/view all users/groups from a certain realm using the REST interface with the help of the class "org.keycloak.admin.client.Keycloak".

I can get the list of available groups and their subgroups and also the ids and names oft he groups.
But I haven't figured out how I can achieve non-empty return values for the getAttributes() method oft he org.keycloak.representations.idm.GroupRepresentation instances.

Do I need some special configuration or request parameter fort he desired result?

Thanks in advance,
Manfred

--
Manfred Schenk, Fraunhofer IOSB
Informationsmanagement und Leittechnik
Fraunhoferstraße 1,76131 Karlsruhe, Germany
Telefon +49 721 6091-391
mailto:Manfred.Schenk at iosb.fraunhofer.de<mailto:Manfred.Schenk at iosb.fraunhofer.de>
http://www.iosb.fraunhofer.de

_______________________________________________
keycloak-user mailing list
keycloak-user at lists.jboss.org<mailto:keycloak-user at lists.jboss.org>
https://lists.jboss.org/mailman/listinfo/keycloak-user



--
Castor Technologies Inc
460 rue St-Catherine St Ouest, Suite 613
Montréal, Québec H3B-1A7
(514) 360-7208 o
(514) 798-2044 f
ntle at castortech.com<mailto:ntle at castortech.com>
www.castortech.com<http://www.castortech.com>

CONFIDENTIALITY NOTICE: The information contained in this e-mail is confidential and may be proprietary information intended only for the use of the individual or entity to whom it is addressed. If the reader of this message is not the intended recipient, you are hereby notified that any viewing, dissemination, distribution, disclosure, copy or use of the information contained in this e-mail message is strictly prohibited. If you have received and/or are viewing this e-mail in error, please immediately notify the sender by reply e-mail, and delete it from your system without reading, forwarding, copying or saving in any manner. Thank you.
AVIS DE CONFIDENTIALITE: L’information contenue dans ce message est confidentiel, peut être protégé par le secret professionnel et est réservé à l'usage exclusif du destinataire. Toute autre personne est par les présentes avisée qu'il lui est strictement interdit de diffuser, distribuer ou reproduire ce message. Si vous avez reçu cette communication par erreur, veuillez la détruire immédiatement et en aviser l'expéditeur. Merci.


More information about the keycloak-user mailing list