title: Spring boot OAuth successful login listener not triggering
body: <p>Using Spring boot - After successfully authenticating with GitHub OAuth, the Audit listener is not being triggered.</p>
  
  <pre><code>public class AuthenticationListener implements ApplicationListener&lt;InteractiveAuthenticationSuccessEvent&gt; {
  
  @Override
  public void onApplicationEvent(final InteractiveAuthenticationSuccessEvent event) {
         System.out.println("+++++++ ================ ------------");
     }
  
  }
  </code></pre>
  
  <p>Do I need to register it anywhere else? I have tried as suggested else where on Stackoverflow to create a @Bean, but this made no difference.</p>
  
  <p>Full code <a href="https://github.com/DashboardHub/PipelineDashboard/tree/feature/178-login-github" rel="nofollow">https://github.com/DashboardHub/PipelineDashboard/tree/feature/178-login-github</a> </p>
  
  <p><strong>Update</strong></p>
  
  <p>SecurityConfig class</p>
  
  <pre><code>@Configuration
  public class SecurityConfig extends WebSecurityConfigurerAdapter {
  
  @Autowired
  OAuth2ClientContext oauth2ClientContext;
  
  @Override
  protected void configure(HttpSecurity http) throws Exception {
      http.antMatcher("/**")
          .authorizeRequests()
              .antMatchers("/", "/login**", "/webjars/**").permitAll()
              .anyRequest().authenticated()
          .and()
              .formLogin()
              .loginPage("/login")//.failureUrl("/login?error")
              .permitAll()
          .and().logout().logoutSuccessUrl("/").permitAll()
          .and().addFilterBefore(ssoFilter(), BasicAuthenticationFilter.class)
      ;
  }
  
  @Bean
  @ConfigurationProperties("security.oauth2")
  ClientResourcesConfig github() {
      return new ClientResourcesConfig();
  }
  
  private Filter ssoFilter() {
      CompositeFilter filter = new CompositeFilter();
      List&lt;Filter&gt; filters = new ArrayList&lt;&gt;();
      filters.add(ssoFilter(this.github(), "/login/github"));
      filter.setFilters(filters);
      return filter;
  }
  
  private Filter ssoFilter(ClientResourcesConfig client, String path) {
      OAuth2ClientAuthenticationProcessingFilter githubFilter = new OAuth2ClientAuthenticationProcessingFilter(
              path);
      OAuth2RestTemplate githubTemplate = new OAuth2RestTemplate(client.getClient(),
              oauth2ClientContext);
      githubFilter.setRestTemplate(githubTemplate);
      githubFilter.setTokenServices(new UserInfoTokenServices(
              client.getResource().getUserInfoUri(), client.getClient().getClientId()));
      return githubFilter;
  }
  }
  </code></pre>