2010-09-21 81 views
0

我在Grails中使用了acegi安全性。是否有一个登录失败的登录尝试的信息或警告这样的方式:在grails中记录失败的登录尝试

错误springsecurity.GrailsDaoImpl - 找不到用户:XXXXXX要求

登录?

感谢

回答

2

您可以注册安全事件监听器,检查失败的登录事件

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 
} 
+0

他使用Acegi插件,所以它非常相似,但文档位于http://grails.org/AcegiSecurity+Plugin+-+Acegi+Events – 2010-09-21 15:23:52