我有 grails 插件 spring-security-core-1.2.1
我在 grails-app/conf/spring/resources.groovy 中将安全事件侦听器注册为 spring bean:
securityEventListener(LoggingSecurityEventListener)
并在 grails-app/conf/Config.groovy 中添加两个内容:
grails.plugins.springsecurity.useSecurityEventListener = true
grails.plugins.springsecurity.logout.handlerNames =
['rememberMeServices',
'securityContextLogoutHandler',
'securityEventListener']
我的日志/注销监听器
class LoggingSecurityEventListener implements ApplicationListener<AbstractAuthenticationEvent>, LogoutHandler {
void onApplicationEvent(AbstractAuthenticationEvent event) {
System.out.println('appEvent')
}
void logout(HttpServletRequest request, HttpServletResponse response,
Authentication authentication) {
System.out.println('logout')
}
}
在 ApplicationEvent 上运行良好,但注销不起作用可能是什么问题?
或者您可以告诉如何获取所有日志记录用户