Integrating with custom Jahia valves

March 6, 2023
Note: Marketing Factory is renamed to jExperience in version 1.11 and Apache Unomi is renamed to jCustomer. The 1.10 documentation has been updated to reflect the product name change.

If you have (or are planning to develop) custom Jahia valves, they will need to send a login event to jCustomer once the user is successfully authenticated. Failing to do that the Jahia user will not be properly associated with the jCustomer profile and features such as profiling merging will not work properly. All that is required is that a Spring Event is sent internally inside Jahia, jExperience already listens to this event to send a corresponding event to jCustomer. So make sure you include the following code to your valve to send the Spring Application Event :

final AuthValveContext authContext = (AuthValveContext) context;
SpringContextSingleton.getInstance().publishEvent(new LoginEvent(this, jahiaUser, authContext));

where the jahiaUser is the authenticated Jahia user and the context is the context object passed to the valve in the invoke method.