[keycloak-user] [FGTSPAM] Use of event.clientId in FreeMarker

GARDAIS Ionel ionel.gardais at tech-advantage.com
Tue Oct 23 15:29:02 EDT 2018


OK I find the culprit : clientId getter in EventBean is getClient(), not getClientId().
So using event.client is OK.


-- 
Ionel GARDAIS
Tech'Advantage CIO - IT Team manager

----- Mail original -----
De: "Ionel GARDAIS" <ionel.gardais at tech-advantage.com>
À: "keycloak-user" <keycloak-user at lists.jboss.org>
Envoyé: Lundi 22 Octobre 2018 14:03:25
Objet: [FGTSPAM] [keycloak-user] Use of event.clientId in FreeMarker

Hi, 

I've configured the localisation and FTL templates to send an email at every successful login. 
I'd like to add, beside the date and the source IP, the client through the user was connected 

However, event.clientId always resolves to null, whereas event.ipAddress and event.date are correct. 

Here is what lies in the .ftl file : 
${msg("eventLoginBody",event.date,event.ipAddress,event.clientId)} 

messages_en.properties contains 
eventLoginSubject=Successful login 
eventLoginBody=A successful login was detected to your account on {0} from {1} for {2}. If this was not you, please contact an admin. 
eventLoginBodyHtml=<p>A successful login was detected to your account on {0} from {1} for {2}. If this was not you, please contact an admin.</p> 


If I logg the event to the console, clientId is correctly set. 


Does EmailTemplateProvider swallow the clientId field ? 
Am I missing something in the template definition ? 


Thanks, 
Ionel 

		

Ionel GARDAIS 
CIO - IT Team manager 


--
232 avenue Napoleon BONAPARTE 92500 RUEIL MALMAISON
Capital EUR 219 300,00 - RCS Nanterre B 408 832 301 - TVA FR 09 408 832 301
_______________________________________________
keycloak-user mailing list
keycloak-user at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/keycloak-user
--
232 avenue Napoleon BONAPARTE 92500 RUEIL MALMAISON
Capital EUR 219 300,00 - RCS Nanterre B 408 832 301 - TVA FR 09 408 832 301




More information about the keycloak-user mailing list