<p dir="ltr"><br>
I was going to email regarding this.</p>
<p dir="ltr">Thanks for bringing this up.  We see the guid or something where it should be the username. Can this be configurable to use the email address?<br></p>
<p dir="ltr">Thanks<br>
Sam</p>
<div class="gmail_quote">On Oct 31, 2014 8:29 AM, &quot;Bill Burke&quot; &lt;<a href="mailto:bburke@redhat.com">bburke@redhat.com</a>&gt; wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I&#39;ll add a flag to the adapter then.  The reason is, again, pure servlet<br>
apps, like BRMS that display the principal name in their UI.<br>
<br>
On 10/31/2014 3:11 AM, Stian Thorgersen wrote:<br>
&gt; -1<br>
&gt;<br>
&gt; We should stick with ID as we can guarantee that it&#39;s unique (in the future).<br>
&gt;<br>
&gt; If app starts using the username in their dbs you can end up with situations where the wrong user gets access to things he shouldn&#39;t. For example:<br>
&gt;<br>
&gt; * If user with username userA is removed from Keycloak, then later a new user is registered as userA<br>
&gt; * If we support changing username in the future (this is on the road-map, and IMO it makes sense to add this with a toggle in the realm to enable/disable)<br>
&gt;<br>
&gt; What difference does it make if it&#39;s ugly? If apps wants to display details about the user they should get the profile. Sadly there&#39;s no direct support for this in Principal.<br>
&gt;<br>
&gt; ----- Original Message -----<br>
&gt;&gt; From: &quot;Bill Burke&quot; &lt;<a href="mailto:bburke@redhat.com">bburke@redhat.com</a>&gt;<br>
&gt;&gt; To: <a href="mailto:keycloak-dev@lists.jboss.org">keycloak-dev@lists.jboss.org</a><br>
&gt;&gt; Sent: Thursday, 30 October, 2014 11:29:59 PM<br>
&gt;&gt; Subject: [keycloak-dev] Create Principal instance with username instead?<br>
&gt;&gt;<br>
&gt;&gt; Right no UserPrincipal is created in the adapters using the user id.<br>
&gt;&gt; For strictly pure Servlet apps, an ID is pretty ugly.  I don&#39;t want to<br>
&gt;&gt; force them to use keycloak code.<br>
&gt;&gt;<br>
&gt;&gt; So...is it ok to populate the principal name with<br>
&gt;&gt; accessToken.getPreferredUsername()?<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; Bill Burke<br>
&gt;&gt; JBoss, a division of Red Hat<br>
&gt;&gt; <a href="http://bill.burkecentral.com" target="_blank">http://bill.burkecentral.com</a><br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; keycloak-dev mailing list<br>
&gt;&gt; <a href="mailto:keycloak-dev@lists.jboss.org">keycloak-dev@lists.jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/keycloak-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-dev</a><br>
&gt;&gt;<br>
<br>
--<br>
Bill Burke<br>
JBoss, a division of Red Hat<br>
<a href="http://bill.burkecentral.com" target="_blank">http://bill.burkecentral.com</a><br>
_______________________________________________<br>
keycloak-dev mailing list<br>
<a href="mailto:keycloak-dev@lists.jboss.org">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><br>
</blockquote></div>