Skip to Content
0
Sep 09, 2019 at 09:04 PM

Set Employee lastLogin field on Backoffice Login

588 Views Last edit Oct 29, 2019 at 05:22 PM 3 rev

Hi,

I have a requirement where i need to set employee lastLogin field in backoffice on successful login of backoffice users.

Did some digging into it and I am trying to to override ResetConfigurationAuthenticationSuccessHandler/BackofficeAuthenticationSuccessHandler class and its bean backofficeAuthenticationSuccessHandler in my custom extension and set the lastLogin field in the overridden success handler.

But I am getting the following error on server startup:

[Hybris Version:1811]

[BackofficeApplicationContext] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.filterChains': Cannot resolve reference to bean 'org.springframework.security.web.DefaultSecurityFilterChain#4' while setting bean property 'sourceList' with key [4]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.web.DefaultSecurityFilterChain#4': Cannot resolve reference to bean 'org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#0' while setting constructor argument with key [4]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#0': Cannot resolve reference to bean 'backofficeAuthenticationSuccessHandler' while setting bean property 'authenticationSuccessHandler'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'configurationAuthenticationSuccessHandler' defined in class path resource [custombackoffice-spring-security-config.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'com.hybris.backoffice.cockpitng.user.BackofficeCockpitUserService' to required type 'com.hybris.cockpitng.core.user.CockpitUserService' for property 'cockpitUserService'; nested exception is java.lang.IllegalStateException: Cannot convert value of type 'com.hybris.backoffice.cockpitng.user.BackofficeCockpitUserService' to required type 'com.hybris.cockpitng.core.user.CockpitUserService' for property 'cockpitUserService': no matching editors or conversion strategy found