<div dir="ltr">You&#39;re right, the event is fired after the user is deleted so it won&#39;t be available. You can create a JIRA feature request if you want.</div><div class="gmail_extra"><br><div class="gmail_quote">On 13 June 2016 at 18:31, Jairo Henao <span dir="ltr">&lt;<a href="mailto:jahenao@itroisolutions.com" target="_blank">jahenao@itroisolutions.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><a name="m_1859713640510212423__MailEndCompose"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">Thanks Stian:<u></u><u></u></span></a></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">Your suggestion works well for &#39;create&#39; and &#39;update&#39; events, but when I try to use the
<i>session.users().getUserById(userId, realm), </i>the result is null.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Wingdings;color:#1f497d">L</span><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><b><span style="font-size:10.0pt;font-family:Consolas;color:#7f0055">if</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black"> (</span><span style="font-size:10.0pt;font-family:Consolas;color:#6a3e3e">event</span><span style="font-size:10.0pt;font-family:Consolas;color:black">.getRealmId()
 != </span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7f0055">null</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black"> &amp;&amp;
</span><span style="font-size:10.0pt;font-family:Consolas;color:#6a3e3e">event</span><span style="font-size:10.0pt;font-family:Consolas;color:black">.getAuthDetails().getUserId() !=
</span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7f0055">null</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black"> &amp;&amp;
</span><span style="font-size:10.0pt;font-family:Consolas;color:#6a3e3e">event</span><span style="font-size:10.0pt;font-family:Consolas;color:black">.getResourcePath() !=
</span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7f0055">null</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black"> &amp;&amp;
</span><span style="font-size:10.0pt;font-family:Consolas;color:#6a3e3e">event</span><span style="font-size:10.0pt;font-family:Consolas;color:black">.getResourcePath().startsWith(</span><span style="font-size:10.0pt;font-family:Consolas;color:#2a00ff">&quot;users/&quot;</span><span style="font-size:10.0pt;font-family:Consolas;color:black">))
 {</span><span style="font-size:10.0pt;font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">                     RealmModel
</span><span style="font-size:10.0pt;font-family:Consolas;color:#6a3e3e">realm</span><span style="font-size:10.0pt;font-family:Consolas;color:black"> =
</span><span style="font-size:10.0pt;font-family:Consolas;color:#0000c0">model</span><span style="font-size:10.0pt;font-family:Consolas;color:black">.getRealm(</span><span style="font-size:10.0pt;font-family:Consolas;color:#6a3e3e">event</span><span style="font-size:10.0pt;font-family:Consolas;color:black">.getRealmId());</span><span style="font-size:10.0pt;font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">                     String
</span><span style="font-size:10.0pt;font-family:Consolas;color:#6a3e3e">userId</span><span style="font-size:10.0pt;font-family:Consolas;color:black"> =
</span><span style="font-size:10.0pt;font-family:Consolas;color:#6a3e3e">event</span><span style="font-size:10.0pt;font-family:Consolas;color:black">.getResourcePath().substring(</span><span style="font-size:10.0pt;font-family:Consolas;color:#6a3e3e">event</span><span style="font-size:10.0pt;font-family:Consolas;color:black">.getResourcePath().lastIndexOf(</span><span style="font-size:10.0pt;font-family:Consolas;color:#2a00ff">&quot;/&quot;</span><span style="font-size:10.0pt;font-family:Consolas;color:black">)+1);</span><span style="font-size:10.0pt;font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">            UserModel
</span><span style="font-size:10.0pt;font-family:Consolas;color:#6a3e3e">user</span><span style="font-size:10.0pt;font-family:Consolas;color:black"> =
</span><span style="font-size:10.0pt;font-family:Consolas;color:#0000c0">session</span><span style="font-size:10.0pt;font-family:Consolas;color:black">.users().getUserById(</span><span style="font-size:10.0pt;font-family:Consolas;color:#6a3e3e">userId</span><span style="font-size:10.0pt;font-family:Consolas;color:black">,
</span><span style="font-size:10.0pt;font-family:Consolas;color:#6a3e3e">realm</span><span style="font-size:10.0pt;font-family:Consolas;color:black">);</span><span style="font-size:10.0pt;font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">                    
</span><span style="font-size:10.0pt;font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">           
</span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7f0055">if</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black"> (</span><span style="font-size:10.0pt;font-family:Consolas;color:#6a3e3e">user</span><span style="font-size:10.0pt;font-family:Consolas;color:black">
 != </span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7f0055">null</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black">) {</span><span style="font-size:10.0pt;font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">                          
</span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7f0055">if</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black">(OperationType.</span><b><i><span style="font-size:10.0pt;font-family:Consolas;color:#0000c0">DELETE</span></i></b><span style="font-size:10.0pt;font-family:Consolas;color:black">.equals(</span><span style="font-size:10.0pt;font-family:Consolas;color:#6a3e3e">event</span><span style="font-size:10.0pt;font-family:Consolas;color:black">.getOperationType())){</span><span style="font-size:10.0pt;font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">                                 
</span><span style="font-size:10.0pt;font-family:Consolas;color:#3f7f5f">//Deleting the user in Hubspot
</span><span style="font-size:10.0pt;font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">                                 
</span><b><i><span style="font-size:10.0pt;font-family:Consolas;color:#0000c0">log</span></i></b><span style="font-size:10.0pt;font-family:Consolas;color:black">.infov(</span><span style="font-size:10.0pt;font-family:Consolas;color:#2a00ff">&quot;Deleting the user
 (ID={0}) in Hubspot...&quot;</span><span style="font-size:10.0pt;font-family:Consolas;color:black">,
</span><span style="font-size:10.0pt;font-family:Consolas;color:#6a3e3e">user</span><span style="font-size:10.0pt;font-family:Consolas;color:black">.getEmail());</span><span style="font-size:10.0pt;font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">                           }</span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7f0055">else</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black">
</span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7f0055">if</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black">(OperationType.</span><b><i><span style="font-size:10.0pt;font-family:Consolas;color:#0000c0">UPDATE</span></i></b><span style="font-size:10.0pt;font-family:Consolas;color:black">.equals(</span><span style="font-size:10.0pt;font-family:Consolas;color:#6a3e3e">event</span><span style="font-size:10.0pt;font-family:Consolas;color:black">.getOperationType())){</span><span style="font-size:10.0pt;font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">                                 
</span><span style="font-size:10.0pt;font-family:Consolas;color:#3f7f5f">//Deleting the user in Hubspot
</span><span style="font-size:10.0pt;font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">                                 
</span><b><i><span style="font-size:10.0pt;font-family:Consolas;color:#0000c0">log</span></i></b><span style="font-size:10.0pt;font-family:Consolas;color:black">.infov(</span><span style="font-size:10.0pt;font-family:Consolas;color:#2a00ff">&quot;Updating the user
 (ID={0}) in Hubspot...&quot;</span><span style="font-size:10.0pt;font-family:Consolas;color:black">,
</span><span style="font-size:10.0pt;font-family:Consolas;color:#6a3e3e">user</span><span style="font-size:10.0pt;font-family:Consolas;color:black">.getEmail());</span><span style="font-size:10.0pt;font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">                           }</span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7f0055">else</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black">
</span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7f0055">if</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black">(OperationType.</span><b><i><span style="font-size:10.0pt;font-family:Consolas;color:#0000c0">CREATE</span></i></b><span style="font-size:10.0pt;font-family:Consolas;color:black">.equals(</span><span style="font-size:10.0pt;font-family:Consolas;color:#6a3e3e">event</span><span style="font-size:10.0pt;font-family:Consolas;color:black">.getOperationType())){</span><span style="font-size:10.0pt;font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">                                 
</span><span style="font-size:10.0pt;font-family:Consolas;color:#3f7f5f">//Deleting the user in Hubspot
</span><span style="font-size:10.0pt;font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">                                 
</span><b><i><span style="font-size:10.0pt;font-family:Consolas;color:#0000c0">log</span></i></b><span style="font-size:10.0pt;font-family:Consolas;color:black">.infov(</span><span style="font-size:10.0pt;font-family:Consolas;color:#2a00ff">&quot;Registering the
 user (ID={0}) in Hubspot...&quot;</span><span style="font-size:10.0pt;font-family:Consolas;color:black">,
</span><span style="font-size:10.0pt;font-family:Consolas;color:#6a3e3e">user</span><span style="font-size:10.0pt;font-family:Consolas;color:black">.getEmail());</span><span style="font-size:10.0pt;font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">                           }</span><span style="font-size:10.0pt;font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">            }</span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7f0055">else</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black">{</span><span style="font-size:10.0pt;font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">             
</span><b><i><span style="font-size:10.0pt;font-family:Consolas;color:#0000c0">log</span></i></b><span style="font-size:10.0pt;font-family:Consolas;color:black">.errorv(</span><span style="font-size:10.0pt;font-family:Consolas;color:#2a00ff">&quot;No User found
 with ID={0}, Operation={1}&quot;</span><span style="font-size:10.0pt;font-family:Consolas;color:black">,
</span><span style="font-size:10.0pt;font-family:Consolas;color:#6a3e3e">userId</span><span style="font-size:10.0pt;font-family:Consolas;color:black">,
</span><span style="font-size:10.0pt;font-family:Consolas;color:#6a3e3e">event</span><span style="font-size:10.0pt;font-family:Consolas;color:black">.getOperationType());</span><span style="font-size:10.0pt;font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">            }</span><span style="font-size:10.0pt;font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">              }</span><b><span style="font-size:10.0pt;font-family:Consolas;color:#7f0055">else</span></b><span style="font-size:10.0pt;font-family:Consolas;color:black">{</span><span style="font-size:10.0pt;font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">             
</span><b><i><span style="font-size:10.0pt;font-family:Consolas;color:#0000c0">log</span></i></b><span style="font-size:10.0pt;font-family:Consolas;color:black">.errorv(</span><span style="font-size:10.0pt;font-family:Consolas;color:#2a00ff">&quot;No Realm ID or
 User ID found&quot;</span><span style="font-size:10.0pt;font-family:Consolas;color:black">);</span><span style="font-size:10.0pt;font-family:Consolas"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:Consolas;color:black">        }<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:Consolas;color:black"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:Consolas;color:black"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:Consolas;color:black"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:Consolas;color:black"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">2016-06-13 11:22:02,502 INFO  [com.itroi.keycloak.events.hubspot.HubspotEventListenerProvider] (default task-56) Registering the user (ID=<a href="mailto:user500@mail.com" target="_blank">user500@mail.com</a>) in
 Hubspot...<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">2016-06-13 11:22:19,463 INFO  [com.itroi.keycloak.events.hubspot.HubspotEventListenerProvider] (default task-64) Updating the user (ID=<a href="mailto:user500@mail2.com" target="_blank">user500@mail2.com</a>) in Hubspot...<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">2016-06-13 11:22:32,403 ERROR [com.itroi.keycloak.events.hubspot.HubspotEventListenerProvider] (default task-7) No User found with ID=179e55e6-5788-4a10-a640-6661485bfa95,
 Operation=DELETE<u></u><u></u></span></p><span class="">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,sans-serif;color:#1f497d"><u></u> <u></u></span></b></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,sans-serif;color:#1f497d">Jairo Henao Rojas<u></u><u></u></span></b></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Tahoma&quot;,sans-serif;color:#1f497d">IT ROI Solutions<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Tahoma&quot;,sans-serif;color:#1f497d">Software Architect
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Tahoma&quot;,sans-serif;color:#1f497d">Mobile  : <a href="tel:314-738-6032" value="+13147386032" target="_blank">314-738-6032</a><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Tahoma&quot;,sans-serif;color:#1f4e79">Office Colombia: + <a href="tel:%28571%29%20381-9185" value="+15713819185" target="_blank">(571) 381-9185</a><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Tahoma&quot;,sans-serif;color:#1f4e79">Office Mexico: <a href="tel:%2B%2052-81-4624-4468" value="+528146244468" target="_blank">+ 52-81-4624-4468</a><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Tahoma&quot;,sans-serif;color:#1f4e79">Office Chile: + 5622-582-2257<br>
Office USA:  <a href="tel:954-518-3330" value="+19545183330" target="_blank">954-518-3330</a><u><u></u><u></u></u></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Tahoma&quot;,sans-serif;color:#1f4e79">Office Canada:  <a href="tel:604-998-2280" value="+16049982280" target="_blank">604-998-2280</a></span><span lang="es-419" style="font-size:9.0pt;font-family:&quot;Tahoma&quot;,sans-serif;color:#1f4e79"><u></u><u></u></span></p>
<p class="MsoNormal"><a href="mailto:jahenao@itroisolutions.com" target="_blank"><span lang="es-419" style="font-size:9.0pt;font-family:&quot;Tahoma&quot;,sans-serif;color:#0563c1">jahenao</span><span lang="ES-CO" style="font-size:9.0pt;font-family:&quot;Tahoma&quot;,sans-serif;color:#0563c1">@itroisolution</span><span lang="es-419" style="font-size:9.0pt;font-family:&quot;Tahoma&quot;,sans-serif;color:#0563c1">s</span><span lang="ES-CO" style="font-size:9.0pt;font-family:&quot;Tahoma&quot;,sans-serif;color:#0563c1">.com</span></a><u><span lang="ES-CO" style="font-size:9.0pt;font-family:&quot;Tahoma&quot;,sans-serif;color:#1f497d"><u></u><u></u></span></u></p>
<p class="MsoNormal"><span lang="ES-CO" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"><img border="0" width="103" height="22" src="cid:image001.png@01D1C567.29DCBAD0" alt="cid:image001.png@01CFACA6.CA39D4D0"></span><span lang="ES-CO" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="ES-CO" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><a href="https://twitter.com/ITROISolutions" target="_blank"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;text-decoration:none"><img border="0" width="32" height="32" src="cid:image002.png@01D1C567.29DCBAD0" alt="Description: Description: cid:image002.png@01CD70CF.8782CD50"></span></a><a href="http://www.linkedin.com/company/itroi-solutions" target="_blank"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;text-decoration:none"><img border="0" width="32" height="32" src="cid:image003.png@01D1C567.29DCBAD0" alt="Description: Description: cid:image003.png@01CD70CF.8782CD50"></span></a><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"> </span><a href="http://www.facebook.com/pages/IT-ROI-Solutions-CA-Clarity-Consultants/110571835703154" target="_blank"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;text-decoration:none"><img border="0" width="32" height="32" src="cid:image004.png@01D1C567.29DCBAD0" alt="Description: Description: cid:image004.png@01CD70CF.8782CD50"></span></a><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"> </span><a href="http://www.youtube.com/user/ITROISolutions" target="_blank"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;text-decoration:none"><img border="0" width="32" height="32" src="cid:image005.png@01D1C567.29DCBAD0" alt="Description: Description: cid:image005.png@01CD70CF.8782CD50"></span></a><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"><u></u> <u></u></span></p>
</span><p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif"> Stian Thorgersen [mailto:<a href="mailto:sthorger@redhat.com" target="_blank">sthorger@redhat.com</a>]
<br>
<b>Sent:</b> Monday, June 13, 2016 8:28 AM<br>
<b>To:</b> Jairo Henao &lt;<a href="mailto:jahenao@itroisolutions.com" target="_blank">jahenao@itroisolutions.com</a>&gt;<br>
<b>Cc:</b> <a href="mailto:keycloak-user@lists.jboss.org" target="_blank">keycloak-user@lists.jboss.org</a><br>
<b>Subject:</b> Re: [keycloak-user] Getting the user email before delete it<u></u><u></u></span></p><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">You can get the user object from session.users().getUserById(..), which will give you the email.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On 11 June 2016 at 08:58, Jairo Henao &lt;<a href="mailto:jahenao@itroisolutions.com" target="_blank">jahenao@itroisolutions.com</a>&gt; wrote:<u></u><u></u></p>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal">Hello community:<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">I have a listener that is pending when an administrator deletes a user. How I can get the user email?<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Apparently I can only get his ID, but I need his email to delete it in HubSpot.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">There is something like a pre-delete event?<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Thanks,<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,sans-serif;color:#1f497d"> </span></b><u></u><u></u></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,sans-serif;color:#1f497d">Jairo Henao Rojas</span></b><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Tahoma&quot;,sans-serif;color:#1f497d">IT ROI Solutions</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Tahoma&quot;,sans-serif;color:#1f497d">Software Architect
</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Tahoma&quot;,sans-serif;color:#1f497d">Mobile  :
<a href="tel:314-738-6032" target="_blank">314-738-6032</a></span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Tahoma&quot;,sans-serif;color:#1f4e79">Office Colombia: +
<a href="tel:%28571%29%20381-9185" target="_blank">(571) 381-9185</a></span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Tahoma&quot;,sans-serif;color:#1f4e79">Office Mexico:
<a href="tel:%2B%2052-81-4624-4468" target="_blank">+ 52-81-4624-4468</a></span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Tahoma&quot;,sans-serif;color:#1f4e79">Office Chile: + 5622-582-2257<br>
Office USA:  <a href="tel:954-518-3330" target="_blank">954-518-3330</a></span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Tahoma&quot;,sans-serif;color:#1f4e79">Office Canada: 
<a href="tel:604-998-2280" target="_blank">604-998-2280</a></span><u></u><u></u></p>
<p class="MsoNormal"><u><span lang="es-419" style="font-size:9.0pt;font-family:&quot;Tahoma&quot;,sans-serif;color:#1f497d"><a href="mailto:jahenao@itroisolutions.com" target="_blank"><span style="color:#0563c1">jahenao</span><span lang="ES-CO" style="color:#0563c1">@itroisolution</span><span style="color:#0563c1">s</span><span lang="ES-CO" style="color:#0563c1">.com</span></a></span></u><u></u><u></u></p>
<p class="MsoNormal"><span lang="ES-CO" style="color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d"><img border="0" width="103" height="22" src="cid:image001.png@01D1C567.29DCBAD0" alt="cid:image001.png@01CFACA6.CA39D4D0"></span><u></u><u></u></p>
<p class="MsoNormal"><span lang="ES-CO" style="color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><a href="https://twitter.com/ITROISolutions" target="_blank"><span style="text-decoration:none"><img border="0" width="32" height="32" src="cid:image002.png@01D1C567.29DCBAD0" alt="Description: Description: cid:image002.png@01CD70CF.8782CD50"></span></a><a href="http://www.linkedin.com/company/itroi-solutions" target="_blank"><span style="text-decoration:none"><img border="0" width="32" height="32" src="cid:image003.png@01D1C567.29DCBAD0" alt="Description: Description: cid:image003.png@01CD70CF.8782CD50"></span></a><span style="color:#1f497d"> </span><a href="http://www.facebook.com/pages/IT-ROI-Solutions-CA-Clarity-Consultants/110571835703154" target="_blank"><span style="text-decoration:none"><img border="0" width="32" height="32" src="cid:image004.png@01D1C567.29DCBAD0" alt="Description: Description: cid:image004.png@01CD70CF.8782CD50"></span></a><span style="color:#1f497d"> </span><a href="http://www.youtube.com/user/ITROISolutions" target="_blank"><span style="text-decoration:none"><img border="0" width="32" height="32" src="cid:image005.png@01D1C567.29DCBAD0" alt="Description: Description: cid:image005.png@01CD70CF.8782CD50"></span></a><u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"><br>
_______________________________________________<br>
keycloak-user mailing list<br>
<a href="mailto:keycloak-user@lists.jboss.org" target="_blank">keycloak-user@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/keycloak-user" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-user</a><u></u><u></u></p>
</blockquote>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div></div></div>
</div>

</blockquote></div><br></div>