Posted By

lucastex on 03/18/09


Tagged

event listener groovy grails acegi


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

sfhynx


Implementing my own Acegi Security events listener


 / Published in: Groovy
 

  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  

You need to login to post a comment.