Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 3.0.0 RC1
    • Fix Version/s: 3.0.0.RC2
    • Component/s: Web
    • Labels:
      None

      Description

      With 3.0M2 and before I used the following code to register successful registrations and save client's IPs

      [code]
      public class AuthenticationListener implements ApplicationListener {

      @Override
      public void onApplicationEvent(ApplicationEvent event) {
      if (event instanceof AuthenticationSuccessEvent)

      { onAuthenticationSuccessEvent((AuthenticationSuccessEvent) event); }

      }

      public void onAuthenticationSuccessEvent(AuthenticationSuccessEvent authenticationSuccessEvent)

      { // my code }

      }
      [/code]

      With 3.0RC1 there are no AuthenticationSuccessEvent events any more. I've found the following comment for org.springframework.security.authentication.DefaultAuthenticationEventPublisher

      "The default strategy used by <tt>ProviderManager</tt> for publishing authentication events."

      But when I looked in ProviderManager I've found that the default strategy is NullEventPublisher which is created by private field's initializer.

      I thought that it's possible to inject DefaultAuthenticationEventPublisher with default XML security scheme but I've found no entry point to do this.

        Issue Links

          Activity

          Hide
          Nickolay Mazurkin added a comment -

          After some research I've changed code to

          [code]
          public class AuthenticationListener implements ApplicationListener {

          @Override
          public void onApplicationEvent(ApplicationEvent event) {
          if (event instanceof AbstractAuthenticationEvent)

          { handleAuthenticationSuccessEvent((AbstractAuthenticationEvent) event); }

          }

          public void handleAuthenticationSuccessEvent(AbstractAuthenticationEvent authenticationSuccessEvent)

          { // my code... }

          [/code]

          Seems everything works fine right now

          Show
          Nickolay Mazurkin added a comment - After some research I've changed code to [code] public class AuthenticationListener implements ApplicationListener { @Override public void onApplicationEvent(ApplicationEvent event) { if (event instanceof AbstractAuthenticationEvent) { handleAuthenticationSuccessEvent((AbstractAuthenticationEvent) event); } } public void handleAuthenticationSuccessEvent(AbstractAuthenticationEvent authenticationSuccessEvent) { // my code... } [/code] Seems everything works fine right now
          Hide
          Nickolay Mazurkin added a comment -

          It've mistaken - use InteractiveAuthenticationSuccessEvent not AbstractAuthenticationEvent

          [code]
          public class AuthenticationListener implements ApplicationListener {

          @Override
          public void onApplicationEvent(ApplicationEvent event) {
          if (event instanceof InteractiveAuthenticationSuccessEvent )

          { handleAuthenticationSuccessEvent((InteractiveAuthenticationSuccessEvent ) event); }

          }

          public void handleAuthenticationSuccessEvent(InteractiveAuthenticationSuccessEvent authenticationSuccessEvent)

          { // my code... }

          [/code]

          Show
          Nickolay Mazurkin added a comment - It've mistaken - use InteractiveAuthenticationSuccessEvent not AbstractAuthenticationEvent [code] public class AuthenticationListener implements ApplicationListener { @Override public void onApplicationEvent(ApplicationEvent event) { if (event instanceof InteractiveAuthenticationSuccessEvent ) { handleAuthenticationSuccessEvent((InteractiveAuthenticationSuccessEvent ) event); } } public void handleAuthenticationSuccessEvent(InteractiveAuthenticationSuccessEvent authenticationSuccessEvent) { // my code... } [/code]

            People

            • Assignee:
              Luke Taylor
              Reporter:
              Nickolay Mazurkin
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: