<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Hi everybody<br>
    <br>
    Sorry very much... I was too stupid!!!<br>
    <tt><a href="cid:part1.09090803.09070605@naef-itcom.ch">GET
        /admin/realms/{realm}/users/{id}/role-mappings</a><br>
    </tt><br>
    I set {id} as user NAME, not user ID. Now it's clear.<br>
    <br>
    Sorry again to pollute the mailing list with such stupid questions,
    but maybe someone will find it with google and then he won't make
    this stupid error!<br>
    <br>
    <br>
    <br>
    <div class="moz-cite-prefix">Am 11.09.2015 um 13:17 schrieb Patrick
      Andreas Näf:<br>
    </div>
    <blockquote cite="mid:55F2B840.7080201@naef-itcom.ch" type="cite">
      <pre wrap="">Hi everybody

Started with the example:
<a class="moz-txt-link-freetext" href="https://github.com/keycloak/keycloak/blob/master/examples/demo-template/admin-access-app/src/main/java/org/keycloak/example/AdminClient.java">https://github.com/keycloak/keycloak/blob/master/examples/demo-template/admin-access-app/src/main/java/org/keycloak/example/AdminClient.java</a> 

That worked.

Then tried to get also the other interfaces.
Also that works:
/auth/admin/realms/REALM/users
But i don't get the roles of the user here.
So i think the permissions are there, i can get data.

If i try this:
/auth/admin/realms/REALM/users/NAME_OF_USER/role-mappings

i get an 404 error.
my code is:
String url = 
<a class="moz-txt-link-rfc2396E" href="http://localhost:8081/auth/admin/realms/REALM/users/NAME_OF_USER/role-mappings">"http://localhost:8081/auth/admin/realms/REALM/users/NAME_OF_USER/role-mappings"</a>; 

HttpGet get = new HttpGet(url);
get.addHeader("Authorization", "Bearer " + res.getToken());
HttpResponse response = client.execute(get);


if i open the same url in the browser i see "Bearer", what is logic to 
me and it shows that the server is there and the url is correct.

Keycloak version is 1.3.1.Final
Java: 8

Thanks a lot for you help / pointing me to the right place.



_______________________________________________
keycloak-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/keycloak-user">https://lists.jboss.org/mailman/listinfo/keycloak-user</a>

</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Näf ITCom AG
Patrick Andreas Näf
CEO / Owner
MSc ETH Inf.-Ing.
Höhenweg 7
4917 Melchnau

web: <a class="moz-txt-link-abbreviated" href="http://www.naef-itcom.ch">www.naef-itcom.ch</a></pre>
  </body>
</html>