<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Hi,<br>
<br>
you added a user and then you authenticated with this user to
keycloak application? <br>
<br>
The "nothing here" means that whole variable "session" is null or
just that name and email are missing in the token? If it's the
first case, then I suspect that you didn't authenticate user with
the Keycloak at all. Make sure to mark all the
security-constraints URLs into web.xml (check the examples for
details). If just the name and email is missing in the token, then
doublecheck if your user has the values you gave to him (you can
do it in admin console). Other possibility is that your client
doesn't have protocol mappers, but I don't think error is here as
name and email protocol mappers are added by default.<br>
<br>
Marek<br>
<br>
<br>
On 05/10/15 06:19, Mai Zi wrote:<br>
</div>
<blockquote
cite="mid:1113328523.419743.1444018744406.JavaMail.yahoo@mail.yahoo.com"
type="cite">
<div style="color:#000; background-color:#fff;
font-family:garamond, new york, times, serif;font-size:14px">
<div id="yui_3_16_0_1_1444018372732_2917">Hi, there</div>
<div id="yui_3_16_0_1_1444018372732_2917"><br>
</div>
<div id="yui_3_16_0_1_1444018372732_2917" dir="ltr">We add a
user ( with name and email ) via the endpoint :
/admin/realms/demo/users</div>
<div id="yui_3_16_0_1_1444018372732_2917" dir="ltr"><br>
</div>
<div id="yui_3_16_0_1_1444018372732_2917" dir="ltr"><br>
</div>
<div id="yui_3_16_0_1_1444018372732_2917" dir="ltr">and then we
want to get the name and the email from the accesstoken, </div>
<div id="yui_3_16_0_1_1444018372732_2917" dir="ltr"><br>
</div>
<div id="yui_3_16_0_1_1444018372732_2917" dir="ltr"><br>
</div>
<div id="yui_3_16_0_1_1444018372732_2917" dir="ltr">KeycloakSecurityContext
session = (KeycloakSecurityContext)
request.getAttribute(KeycloakSecurityContext.class.getName());</div>
<div id="yui_3_16_0_1_1444018372732_2917" dir="ltr" class=""><span class="" id="yui_3_16_0_1_1444018372732_3081" style="white-space: pre-wrap;">        </span>AccessToken
token=session.getToken();<br>
</div>
</div>
</blockquote>
<blockquote
cite="mid:1113328523.419743.1444018744406.JavaMail.yahoo@mail.yahoo.com"
type="cite">
<div style="color:#000; background-color:#fff;
font-family:garamond, new york, times, serif;font-size:14px">
<div id="yui_3_16_0_1_1444018372732_2917" dir="ltr" class=""><br>
</div>
<div id="yui_3_16_0_1_1444018372732_2917" dir="ltr" class=""><br>
</div>
<div id="yui_3_16_0_1_1444018372732_2917" dir="ltr" class=""><br>
</div>
<div id="yui_3_16_0_1_1444018372732_2917" dir="ltr" class="">but
nothing there. </div>
<div id="yui_3_16_0_1_1444018372732_2917" dir="ltr" class=""><br>
</div>
<div id="yui_3_16_0_1_1444018372732_2917" dir="ltr" class=""><br>
</div>
<div id="yui_3_16_0_1_1444018372732_2917" dir="ltr" class=""><br>
</div>
<div id="yui_3_16_0_1_1444018372732_2917" dir="ltr" class=""><br>
</div>
<div id="yui_3_16_0_1_1444018372732_2917" dir="ltr" class="">Can
anyone help on this?</div>
<div id="yui_3_16_0_1_1444018372732_2917" dir="ltr" class=""><br>
</div>
<div id="yui_3_16_0_1_1444018372732_2917" dir="ltr" class=""><br>
</div>
<div id="yui_3_16_0_1_1444018372732_2917" dir="ltr" class="">T.I.A</div>
<div id="yui_3_16_0_1_1444018372732_2917" dir="ltr" class=""><br>
</div>
<div id="yui_3_16_0_1_1444018372732_2917" dir="ltr" class="">Mai</div>
<div id="yui_3_16_0_1_1444018372732_2917" dir="ltr" class=""><br>
</div>
<div id="yui_3_16_0_1_1444018372732_2917" dir="ltr" class=""><br>
</div>
<div id="yui_3_16_0_1_1444018372732_2917" dir="ltr" class=""><br>
</div>
<div id="yui_3_16_0_1_1444018372732_2917" dir="ltr" class=""><br>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
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>