Results 1 to 3 of 3

Thread: Store Last Login with Http-Basic authentication

  1. #1
    Join Date
    Jan 2012
    Posts
    6

    Default Store Last Login with Http-Basic authentication

    Is there a way that I can implement some post authentication listener so that I can store the last login date when using http-basic? I am using Spring 3.1.0 and Spring Security 3.1.0.

    I have both Http-Basic and form-login implemented and both are working properly. I defined the authentication-success-handler-ref for form-login and implemented a SavedRequestAwareAuthenticationSuccessHandler. Can I do something similar with http-basic?

  2. #2
    Join Date
    Jan 2008
    Posts
    1,826

    Default

    You can register a DefaultAuthenticationEventPublisher as the AuthenticationEventPublisher with the ProviderManager. Then you can capture the events using Spring's standard event model.
    Rob Winch - @rob_winch
    Spring Security Lead
    Pivotal

  3. #3
    Join Date
    Jan 2012
    Posts
    6

    Default

    That worked. I simply created the ApplicationEventListener and defined it in my applicationContext.xml and immediately started receiving Login events. I didn't need to register it with my authentication provider.

    Thanks for the help.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •