<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">If you have 1.1.0.Beta1, you can try to
use "principal-attribute" with value "<code class="literal">preferred_username"
in the configuration of your adapter. More info in </code><a class="moz-txt-link-freetext" href="http://docs.jboss.org/keycloak/docs/1.1.0.Beta1/userguide">http://docs.jboss.org/keycloak/docs/1.1.0.Beta1/userguide</a>
/html/ch07.html#adapter-config . <br>
<br>
It should also work to cast getUserPrincipal() to
KeycloakPrincipal and use something like:<br>
<br>
((KeycloakPrincipal)getUserPrincipal()).getKeycloakSecurityContext().getToken().getPreferredUsername()<br>
<br>
this should also work on older versions, but your code may need to
have dependencies on keycloak.<br>
<br>
Marek<br>
<br>
On 19.11.2014 17:20, Gary Brown wrote:<br>
</div>
<blockquote
cite="mid:1869846893.11462243.1416414017373.JavaMail.zimbra@redhat.com"
type="cite">
<pre wrap="">Hi
When I access getUserPrincipal().getName() in javax.ws.rs.core.SecurityContext I get the UID.
Is it possible to obtain the actual user name?
Regards
Gary
_______________________________________________
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>
</body>
</html>