<div dir="ltr">Looks like there's a difference if you return a specific user or search for users. Returning a user doesn't include null values, while search does. Created <a href="https://issues.jboss.org/browse/KEYCLOAK-1896">https://issues.jboss.org/browse/KEYCLOAK-1896</a><div class="gmail_extra"><br><div class="gmail_quote">On 1 October 2015 at 16:55, Remi Cartier <span dir="ltr"><<a href="mailto:remi.cartier@imetrik.com" target="_blank">remi.cartier@imetrik.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div style="word-wrap:break-word">
Stian,
<div><br>
</div>
<div>that’s actually what I am receiving over the wire. Here is the full log of the communication :</div>
<div><br>
</div>
<div>
<div><font face="Menlo">16:18:58.472 [main] DEBUG org.apache.http.headers - >> GET /auth/admin/realms/imetrik/users?first=0&max=<a href="tel:2147483647" value="+12147483647" target="_blank">2147483647</a> HTTP/1.1</font></div>
<div><font face="Menlo">16:18:58.472 [main] DEBUG org.apache.http.headers - >> Accept: application/json</font></div>
<div><font face="Menlo">16:18:58.472 [main] DEBUG org.apache.http.headers - >> Accept-Encoding: gzip, deflate</font></div>
<div><font face="Menlo">16:18:58.472 [main] DEBUG org.apache.http.headers - >> Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.eyJqdGkiOiJhZjk4OTY2OS03YmIwLTRkYjgtOTNiNC0xYWI5NmU1MzgyY2UiLCJleHAiOjE0NDM1NTgyMTEsIm5iZiI6MCwiaWF0IjoxNDQzNTU3OTExLCJpc3MiOiJodHRwOi8vbTRpYi1pZG06ODA4MC9hdXRoL3JlYWxtcy9pbWV0cmlrIiwiYXVkIjoidWJpX2RyaXZlciIsInN1YiI6IjA1NTY3MTdlLWZmYjktNGMyZC1iODViLTUzM2Q5Mzk2ZjI0MyIsImF6cCI6InViaV9kcml2ZXIiLCJzZXNzaW9uX3N0YXRlIjoiMDQyNTdlY2EtMDAxMi00ZDU5LWFjMWItNWQ0NzI1MTFiMTc2IiwiY2xpZW50X3Nlc3Npb24iOiI5OGVkZjRkMC00MTk5LTRjODctYjY0OC1jYzhiYzI3MDhkMmUiLCJhbGxvd2VkLW9yaWdpbnMiOltdLCJyZWFsbV9hY2Nlc3MiOnsicm9sZXMiOlsicmVhbG0tcm9sZSJdfSwicmVzb3VyY2VfYWNjZXNzIjp7InViaV9kcml2ZXIiOnsicm9sZXMiOlsibWlsZWFnZSJdfSwicmVhbG0tbWFuYWdlbWVudCI6eyJyb2xlcyI6WyJ2aWV3LXJlYWxtIiwidmlldy1pZGVudGl0eS1wcm92aWRlcnMiLCJtYW5hZ2UtZXZlbnRzIiwibWFuYWdlLXJlYWxtIiwibWFuYWdlLWlkZW50aXR5LXByb3ZpZGVycyIsImltcGVyc29uYXRpb24iLCJyZWFsbS1hZG1pbiIsInZpZXctZXZlbnRzIiwibWFuYWdlLXVzZXJzIiwidmlldy11c2VycyIsInZpZXctY2xpZW50cyIsIm1hbmFnZS1jbGllbnRzIl19LCJhY2NvdW50Ijp7InJvbGVzIjpbIm1hbmFnZS1hY2NvdW50Iiwidmlldy1wcm9maWxlIl19fSwibmFtZSI6ImZpcnN0IG5hbWUgbGFzdCBuYW1lIiwicHJlZmVycmVkX3VzZXJuYW1lIjoiYWRtaW4iLCJnaXZlbl9uYW1lIjoiZmlyc3QgbmFtZSIsImZhbWlseV9uYW1lIjoibGFzdCBuYW1lIn0.Px7tQJ8TV7ba9urpdNUq-HXul01CebvwSe6mpusMzLmIBJUdlzIJnzXyiuz4_AD9vwdYc5KCMHQ8LbucDs5ZrDYx5JQVJEIAQq6_q7d8hsE2gwp0SPejHvtJgki-hDRiuVlp-8lYGLQ6oJ_ipc6GBeVoaxQU8mmBEailh_rxpRwlXSNkef-r_ixzVwY3EQ5K55V2ivYFLmgEbi4mp7dU1FlzsAlvUOuJzbhVo-pyi0iQBjsvca8IJSIKQetCFxvTNXPIQUk5-bBI96_MOFYyoTenCs2m2ygEBDWB8GabrszAPLGEHEEJ2IgXIEK1kditZ7rXNm-ZgcVGYiBbzhVprQ</font></div>
<div><font face="Menlo">16:18:58.472 [main] DEBUG org.apache.http.headers - >> Host: m4ib-idm:8080</font></div>
<div><font face="Menlo">16:18:58.472 [main] DEBUG org.apache.http.headers - >> Connection: Keep-Alive</font></div>
<div><font face="Menlo">16:18:58.478 [main] DEBUG org.apache.http.wire - << "HTTP/1.1 200 OK[\r][\n]"</font></div>
<div><font face="Menlo">16:18:58.479 [main] DEBUG org.apache.http.wire - << "Connection: keep-alive[\r][\n]"</font></div>
<div><font face="Menlo">16:18:58.479 [main] DEBUG org.apache.http.wire - << "Cache-Control: no-cache[\r][\n]"</font></div>
<div><font face="Menlo">16:18:58.479 [main] DEBUG org.apache.http.wire - << "X-Powered-By: Undertow/1[\r][\n]"</font></div>
<div><font face="Menlo">16:18:58.479 [main] DEBUG org.apache.http.wire - << "Server: WildFly/9[\r][\n]"</font></div>
<div><font face="Menlo">16:18:58.479 [main] DEBUG org.apache.http.wire - << "Transfer-Encoding: chunked[\r][\n]"</font></div>
<div><font face="Menlo">16:18:58.479 [main] DEBUG org.apache.http.wire - << "Content-Type: application/json[\r][\n]"</font></div>
<div><font face="Menlo">16:18:58.479 [main] DEBUG org.apache.http.wire - << "Date: Tue, 29 Sep 2015 20:18:31 GMT[\r][\n]"</font></div>
<div><font face="Menlo">16:18:58.479 [main] DEBUG org.apache.http.wire - << "[\r][\n]"</font></div>
<div><font face="Menlo">16:18:58.479 [main] DEBUG o.a.h.i.conn.DefaultClientConnection - Receiving response: HTTP/1.1 200 OK</font></div>
<div><font face="Menlo">16:18:58.479 [main] DEBUG org.apache.http.headers - << HTTP/1.1 200 OK</font></div>
<div><font face="Menlo">16:18:58.479 [main] DEBUG org.apache.http.headers - << Connection: keep-alive</font></div>
<div><font face="Menlo">16:18:58.479 [main] DEBUG org.apache.http.headers - << Cache-Control: no-cache</font></div>
<div><font face="Menlo">16:18:58.479 [main] DEBUG org.apache.http.headers - << X-Powered-By: Undertow/1</font></div>
<div><font face="Menlo">16:18:58.479 [main] DEBUG org.apache.http.headers - << Server: WildFly/9</font></div>
<div><font face="Menlo">16:18:58.479 [main] DEBUG org.apache.http.headers - << Transfer-Encoding: chunked</font></div>
<div><font face="Menlo">16:18:58.479 [main] DEBUG org.apache.http.headers - << Content-Type: application/json</font></div>
<div><font face="Menlo">16:18:58.479 [main] DEBUG org.apache.http.headers - << Date: Tue, 29 Sep 2015 20:18:31 GMT</font></div>
<div><font face="Menlo">16:18:58.479 [main] DEBUG o.a.h.impl.client.DefaultHttpClient - Connection can be kept alive indefinitely</font></div>
<div><font face="Menlo">16:18:58.480 [main] DEBUG org.apache.http.wire - << "01db[\r][\n]"</font></div>
<div><font face="Menlo">16:18:58.480 [main] DEBUG org.apache.http.wire - << "[{"self":null,"id":"0556717e-ffb9-4c2d-b85b-533d9396f243","createdTimestamp":1443542144845,"username":"admin","enabled":true,"totp":false,"emailVerified":true,"firstName":"first
name","lastName":"last name","email":null,"federationLink":null,"serviceAccountClientId":null,"attributes":{"key1":["value1"]},"credentials":null,"requiredActions":[],"federatedIdentities":null,<font color="#ff4013">"realmRoles":null</font>,<font color="#ff6251">"clientRoles":null</font>,"clientConsents":null,<font color="#ff6a00">"applicationRoles":null</font>,"socialLinks":null}]"</font></div>
<div><font face="Menlo">16:18:58.552 [main] DEBUG org.apache.http.wire - << "[\r][\n]"</font></div>
<div><font face="Menlo">16:18:58.552 [main] DEBUG org.apache.http.wire - << "0[\r][\n]"</font></div>
<div><font face="Menlo">16:18:58.552 [main] DEBUG org.apache.http.wire - << "[\r][\n]"</font></div>
<div><font face="Menlo">16:18:58.552 [main] DEBUG o.a.h.i.c.BasicClientConnectionManager - Releasing connection org.apache.http.impl.conn.ManagedClientConnectionImpl@483f6d77</font></div>
<div><font face="Menlo">16:18:58.552 [main] DEBUG o.a.h.i.c.BasicClientConnectionManager - Connection can be kept alive indefinitely</font></div>
<div><br>
</div>
<div>Regards.</div><span class="">
<div><br>
<hr align="left" style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px;border:0px;width:320px;min-height:1px;background-color:rgb(64,174,73)">
<p class="MsoNormal" style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;margin:0cm 0cm 1pt">
<br style="color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;font-size:12px;line-height:14px">
<span style="color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;font-size:12px;line-height:14px;text-transform:uppercase">REMI CARTIER</span><br style="color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;font-size:12px;line-height:14px">
</p>
<div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<span style="text-align:-webkit-auto;line-height:14px"><font color="#666666" face="Helvetica, Arial, sans-serif">B.O.S.S. (Business & Operation Support Systems) P.O (Product Owner)</font></span></div>
<br style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px">
<strong style="font-size:12px;font-style:normal;font-variant:normal;letter-spacing:normal;text-align:start;text-indent:0px;white-space:normal;word-spacing:0px;color:rgb(64,174,73);font-family:Helvetica,Arial,sans-serif;line-height:14px;text-transform:uppercase">IMETRIK
GLOBAL INC.</strong><span style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px"> </span><br style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px">
<strong style="font-size:12px;font-style:normal;font-variant:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px">T
:</strong><span style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px"> +1
<a href="tel:514%20448-6407%20x2009" value="+15144486407" target="_blank">514 448-6407 x2009</a></span><br style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px">
<strong style="font-size:12px;font-style:normal;font-variant:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px">T
:</strong><span style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px"> +1
<a href="tel:866%20276-5382" value="+18662765382" target="_blank">866 276-5382</a> (toll free) </span><br style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px">
<strong style="font-size:12px;font-style:normal;font-variant:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px">F
:</strong><span style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px"> +1
<a href="tel:514%20904-0611" value="+15149040611" target="_blank">514 904-0611</a> </span><br style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px">
<br style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px">
<span style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px">740
Notre Dame St. West, Suite 1575 </span><br style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px">
<span style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px">Montreal,
Quebec, Canada H3C 3X6 </span><br style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px">
<a href="http://www.imetrik.com/" style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(64,174,73);font-family:Helvetica,Arial,sans-serif;line-height:14px" target="_blank">imetrik.com</a>
</div>
<br>
</span><div><div class="h5"><div>
<blockquote type="cite">
<div>On Oct 1, 2015, at 10:37 AM, Stian Thorgersen <<a href="mailto:sthorger@redhat.com" target="_blank">sthorger@redhat.com</a>> wrote:</div>
<br>
<div>
<div dir="ltr">Just tried it and the returned json for a user is:
<div><br>
<div> {"id":"354094d6-8b32-4c32-b1ae-ccd82c5fdca3","createdTimestamp":1443710165680,"username":"admin","enabled":true,"totp":false,"emailVerified":false,"attributes":{"locale":["en"]},"requiredActions":[]}<br>
</div>
<div><br>
</div>
<div>Which doesn't include the roles field. So this is shown because the way you are printing the user, not because it's included on the wire.</div>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On 1 October 2015 at 16:34, Stian Thorgersen <span dir="ltr">
<<a href="mailto:sthorger@redhat.com" target="_blank">sthorger@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr">Is that the json sent on the wire, or is it after you've marshalled it to UserRepresentation and then printed it back again?</div>
<div>
<div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On 1 October 2015 at 15:34, Remi Cartier <span dir="ltr">
<<a href="mailto:remi.cartier@imetrik.com" target="_blank">remi.cartier@imetrik.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div style="word-wrap:break-word">yes,
<div><br>
</div>
<div>I can see :</div>
<div><br>
</div>
<div>
<div>[</div>
<div> {</div>
<div> "applicationRoles": null,</div>
<div> "attributes": {</div>
<div> "key1": [</div>
<div> "value1"</div>
<div> ]</div>
<div> },</div>
<div> "clientConsents": null,</div>
<div> "clientRoles": null,</div>
<div> "createdTimestamp": 1443542144845,</div>
<div> "credentials": null,</div>
<div> "email": null,</div>
<div> "emailVerified": true,</div>
<div> "enabled": true,</div>
<div> "federatedIdentities": null,</div>
<div> "federationLink": null,</div>
<div> "firstName": "first name",</div>
<div> "id": "0556717e-ffb9-4c2d-b85b-533d9396f243",</div>
<div> "lastName": "last name",</div>
<div> "realmRoles": null,</div>
<div> "requiredActions": [],</div>
<div> "self": null,</div>
<div> "serviceAccountClientId": null,</div>
<div> "socialLinks": null,</div>
<div> "totp": false,</div>
<div> "username": "admin"</div>
<div> }</div>
<div>]</div>
<div><br>
</div>
<div>when doing the query : GET /auth/admin/realms/imetrik/users?first=0&max=<a href="tel:2147483647" value="+12147483647" target="_blank">2147483647</a></div>
<span>
<div><br>
<hr align="left" style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px;border:0px;width:320px;min-height:1px;background-color:rgb(64,174,73)">
<p class="MsoNormal" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;margin:0cm 0cm 1pt">
<br style="color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;font-size:12px;line-height:14px">
<span style="color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;font-size:12px;line-height:14px;text-transform:uppercase">REMI CARTIER</span><br style="color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;font-size:12px;line-height:14px">
</p>
<div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<span style="text-align:-webkit-auto;line-height:14px"><font color="#666666" face="Helvetica, Arial, sans-serif">B.O.S.S. (Business & Operation Support Systems) P.O (Product Owner)</font></span></div>
<br style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px">
<strong style="font-size:12px;font-style:normal;font-variant:normal;letter-spacing:normal;text-align:start;text-indent:0px;white-space:normal;word-spacing:0px;color:rgb(64,174,73);font-family:Helvetica,Arial,sans-serif;line-height:14px;text-transform:uppercase">IMETRIK
GLOBAL INC.</strong><span style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px"> </span><br style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px">
<strong style="font-size:12px;font-style:normal;font-variant:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px">T
:</strong><span style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px"> +1
<a href="tel:514%20448-6407%20x2009" value="+15144486407" target="_blank">
514 448-6407 x2009</a></span><br style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px">
<strong style="font-size:12px;font-style:normal;font-variant:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px">T
:</strong><span style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px"> +1
<a href="tel:866%20276-5382" value="+18662765382" target="_blank">866 276-5382</a> (toll free) </span><br style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px">
<strong style="font-size:12px;font-style:normal;font-variant:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px">F
:</strong><span style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px"> +1
<a href="tel:514%20904-0611" value="+15149040611" target="_blank">514 904-0611</a> </span><br style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px">
<br style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px">
<span style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px">740
Notre Dame St. West, Suite 1575 </span><br style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px">
<span style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px">Montreal,
Quebec, Canada H3C 3X6 </span><br style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px">
<a href="http://www.imetrik.com/" style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(64,174,73);font-family:Helvetica,Arial,sans-serif;line-height:14px" target="_blank">imetrik.com</a>
</div>
<br>
</span>
<div>
<div>
<div>
<blockquote type="cite">
<div>On Oct 1, 2015, at 2:49 AM, Stian Thorgersen <<a href="mailto:sthorger@redhat.com" target="_blank">sthorger@redhat.com</a>> wrote:</div>
<br>
<div>
<div dir="ltr">Sorry, I meant does it include the "roles" field?</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On 30 September 2015 at 16:24, Remi Cartier <span dir="ltr">
<<a href="mailto:remi.cartier@imetrik.com" target="_blank">remi.cartier@imetrik.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div>
<div style="direction:ltr;font-family:Tahoma;font-size:10pt">The JSON response (string) does NOT contain any roles.
<div><br>
<div style="font-family:'Times New Roman';font-size:16px">
<hr>
<div style="direction:ltr"><font face="Tahoma" size="2"><b>From:</b> Stian Thorgersen [<a href="mailto:sthorger@redhat.com" target="_blank">sthorger@redhat.com</a>]<br>
<b>Sent:</b> Wednesday, September 30, 2015 7:39 AM<br>
<b>To:</b> Remi Cartier<br>
<b>Cc:</b> Marek Posolda; <a href="mailto:keycloak-dev@lists.jboss.org" target="_blank">
keycloak-dev@lists.jboss.org</a>
<div>
<div><br>
<b>Subject:</b> Re: [keycloak-dev] Admin REST - User Roles<br>
</div>
</div>
</font><br>
</div>
<div>
<div>
<div></div>
<div>
<div dir="ltr">Does the response actually contain the roles though? You're parsing to <span style="font-size:12.8px">UserRepresentation then printing it out afterwards.</span>
<div class="gmail_extra"><br>
<div class="gmail_quote">On 30 September 2015 at 13:24, Remi Cartier <span dir="ltr">
<<a href="mailto:remi.cartier@imetrik.com" target="_blank">remi.cartier@imetrik.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div bgcolor="#FFFFFF">
<div style="direction:ltr;font-family:Tahoma;font-size:10pt">
<div>Marek,</div>
<div><br>
</div>
<div>I see, thank you for your reply.</div>
<div><br>
</div>
<div>Wouldn't it be less error/question prone if the endpoint returning all the users wouldn't show the *roles attributes ?</div>
<div>Because they will always be null if I understood correctly.</div>
<div><br>
</div>
<div>Regards.</div>
<div><br>
</div>
<div>Rémi.</div>
<br>
<div style="font-family:'Times New Roman';font-size:16px">
<hr>
<div style="direction:ltr"><font face="Tahoma" size="2"><b>From:</b> Marek Posolda [<a href="mailto:mposolda@redhat.com" target="_blank">mposolda@redhat.com</a>]<br>
<b>Sent:</b> Wednesday, September 30, 2015 6:21 AM<br>
<b>To:</b> Remi Cartier; <a href="mailto:keycloak-dev@lists.jboss.org" target="_blank">
keycloak-dev@lists.jboss.org</a><br>
<b>Subject:</b> Re: [keycloak-dev] Admin REST - User Roles<br>
</font><br>
</div>
<div>
<div>
<div></div>
<div>
<div>Hi,<br>
<br>
to retrieve realm role mappings of user, you need to use the endpoint like <a href="http://localhost:8080/auth/admin/realms/demo/users/" target="_blank">
http://localhost:8080/auth/admin/realms/demo/users/</a>{userid}/role-mappings/realm . See the docs for details:
<a href="http://keycloak.github.io/docs/rest-api/overview-index.html" target="_blank">
http://keycloak.github.io/docs/rest-api/overview-index.html</a><br>
<br>
Marek<br>
<br>
On 29/09/15 19:06, Remi Cartier wrote:<br>
</div>
<blockquote type="cite">Hi guys,
<div><br>
</div>
<div>first of all, thank you for that great piece of software, it’s amazing !</div>
<div><br>
</div>
<div>Now, down to business.</div>
<div><br>
</div>
<div>When I do :</div>
<div><br>
</div>
<div>
<div> keycloak = Keycloak.getInstance(getKeycloakServerURL(), getKeycloakRealm(), getKeycloakRealmAdminUsername(), getKeycloakRealmAdminPassword(), getKeycloakClientId());</div>
<div>
<div> for (UserRepresentation userRepresentation : keycloak.realm(getKeycloakRealm()).users().search(null, 0, Integer.MAX_VALUE)) {</div>
<div> <a href="http://log.info/" target="_blank">log.info</a>(ToStringBuilder.reflectionToString(userRepresentation, ToStringStyle.JSON_STYLE));</div>
<div> }</div>
</div>
<div><br>
</div>
<div>The information I get does not contain any roles, all the roles related fields are ‘null’. - </div>
<div><br>
</div>
<div>{"self":null,"id":"0556717e-ffb9-4c2d-b85b-533d9396f243","createdTimestamp":1443542144845,"username":"admin","enabled":true,"totp":false,"emailVerified":true,"firstName":"first name","lastName":"last name","email":null,"federationLink":null,"serviceAccountClientId":null,"attributes":{key1=[value1]},"credentials":null,"requiredActions":[],"federatedIdentities":null,"realmRoles":null,"clientRoles":null,"clientConsents":null,"applicationRoles":null,"socialLinks":null}</div>
<div>However in the admin interface I have setup roles at each layer : realm, client</div>
<div><br>
</div>
<div>The user I am using to do the queries has all the *realm* roles associated.</div>
<div><br>
</div>
<div>is there anything else I need to do ?</div>
<div><br>
</div>
<div>thank you for your help !</div>
<div><br>
<hr align="left" style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px;border:0px;width:320px;min-height:1px;background-color:rgb(64,174,73)">
<p class="MsoNormal" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;margin:0cm 0cm 1pt">
<br style="color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;font-size:12px;line-height:14px">
<span style="color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;font-size:12px;line-height:14px;text-transform:uppercase">REMI CARTIER</span><br style="color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;font-size:12px;line-height:14px">
</p>
<div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<span style="line-height:14px"><font face="Helvetica, Arial,
sans-serif" color="#666666">B.O.S.S. (Business & Operation Support Systems) P.O (Product Owner)</font></span></div>
<br style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px">
<strong style="font-size:12px;font-style:normal;font-variant:normal;letter-spacing:normal;text-align:start;text-indent:0px;white-space:normal;word-spacing:0px;color:rgb(64,174,73);font-family:Helvetica,Arial,sans-serif;line-height:14px;text-transform:uppercase">IMETRIK
GLOBAL INC.</strong><span style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px"> </span><br style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px">
<strong style="font-size:12px;font-style:normal;font-variant:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px">T
:</strong><span style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px"> +1
<a href="tel:514%20448-6407%20x2009" value="+15144486407" target="_blank">
514 448-6407 x2009</a></span><br style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px">
<strong style="font-size:12px;font-style:normal;font-variant:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px">T
:</strong><span style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px"> +1
<a href="tel:866%20276-5382" value="+18662765382" target="_blank">866 276-5382</a> (toll free) </span><br style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px">
<strong style="font-size:12px;font-style:normal;font-variant:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px">F
:</strong><span style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px"> +1
<a href="tel:514%20904-0611" value="+15149040611" target="_blank">514 904-0611</a> </span><br style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px">
<br style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px">
<span style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px">740
Notre Dame St. West, Suite 1575 </span><br style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px">
<span style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px">Montreal,
Quebec, Canada H3C 3X6 </span><br style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,102);font-family:Helvetica,Arial,sans-serif;line-height:14px">
<a href="http://www.imetrik.com/" style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(64,174,73);font-family:Helvetica,Arial,sans-serif;line-height:14px" target="_blank">imetrik.com</a>
</div>
<br>
</div>
<br>
<fieldset></fieldset> <br>
<pre>_______________________________________________
keycloak-dev mailing list
<a href="mailto:keycloak-dev@lists.jboss.org" target="_blank">keycloak-dev@lists.jboss.org</a>
<a href="https://lists.jboss.org/mailman/listinfo/keycloak-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-dev</a></pre>
</blockquote>
<br>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
_______________________________________________<br>
keycloak-dev mailing list<br>
<a href="mailto:keycloak-dev@lists.jboss.org" target="_blank">keycloak-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/keycloak-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-dev</a><br>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
_______________________________________________<br>
keycloak-dev mailing list<br>
<a href="mailto:keycloak-dev@lists.jboss.org" target="_blank">keycloak-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/keycloak-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-dev</a></div>
</blockquote>
</div>
<br>
</div></div></div>
</div>
</blockquote></div><br></div></div>