您可以为安全事件注册侦听器,检查失败的登录事件
http://grails.org/AcegiSecurity+Plugin+-+Acegi+Events
或者,您可以注册在触发事件时调用的回调闭包。
useSecurityEventListener = true
onInteractiveAuthenticationSuccessEvent = {e, appCtx ->
// handle InteractiveAuthenticationSuccessEvent
}
onAbstractAuthenticationFailureEvent = {e, appCtx ->
// handle AbstractAuthenticationFailureEvent
}
onAuthenticationSuccessEvent = {event, appCtx ->
// handle AuthenticationSuccessEvent
}
onAuthenticationSwitchUserEvent = {e, appCtx ->
// handle AuthenticationSwitchUserEvent
}
onAuthorizationEvent = {e, appCtx ->
// handle AuthorizationEvent
}