Need to track user login and logout event by using event listener, but login and logout event-listener is not working

We are using OKTA for Oauth2 token based authentication. Below are steps to make connection.

public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
	protected void configure(HttpSecurity http) throws Exception {

Application works properly, but we had to track user login and logout events.

Written implementation classes of LogoutSuccessHandler for logout,

public class MyLogoutSuccessHandler implements LogoutSuccessHandler{

    public void onLogoutSuccess(HttpServletRequest arg0, HttpServletResponse arg1, Authentication arg2) throws IOException, ServletException {

Configured login and logout event listener in


Problem is that, login and logout event-listener is not working and not listening this event.