Implementing my own Acegi Security events listener


/ Published in: Groovy
Save to your folder(s)



Copy this code and paste it in your HTML
  1. import org.springframework.context.*
  2. import org.springframework.security.event.authentication.*
  3. import org.springframework.security.event.authorization.AbstractAuthorizationEvent
  4.  
  5.  
  6. class AcegiEventListener implements ApplicationListener {
  7.  
  8. void onApplicationEvent(final ApplicationEvent e) {
  9.  
  10. if (e instanceof AbstractAuthenticationEvent) {
  11.  
  12. if (e instanceof AuthenticationSuccessEvent) {
  13.  
  14. println "** Attention: User ${e.source.principal.username} is logged!"
  15. }
  16. }
  17. }
  18. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.