gpt4 book ai didi

grails - 在Grails中记录失败的登录尝试

转载 作者:行者123 更新时间:2023-12-02 15:15:03 25 4
gpt4 key购买 nike

我在Grails中使用acegi安全性。有没有办法将失败的登录尝试记录为信息或警告,因此:

错误springsecurity.GrailsDaoImpl-未找到用户:XXXXXX

是否按要求记录?

谢谢

最佳答案

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

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
}

关于grails - 在Grails中记录失败的登录尝试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3759868/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com