-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathSpringSecurityEventlogGrailsPlugin.groovy
More file actions
37 lines (30 loc) · 1.47 KB
/
SpringSecurityEventlogGrailsPlugin.groovy
File metadata and controls
37 lines (30 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import grails.plugin.springsecurity.SecurityEventListener
import org.springframework.security.authentication.DefaultAuthenticationEventPublisher
import ca.redtoad.eventlog.SpringSecurityEventLogger
class SpringSecurityEventlogGrailsPlugin {
def version = "0.5"
def grailsVersion = "2.0 > *"
def loadBefore = ['springSecurityRest']
def loadAfter = ['springSecurityCore']
def title = "Spring Security Event Log"
def description = 'A plugin to log Spring Security events'
def documentation = "https://github.com/ataylor284/spring-security-eventlog"
def license = "APACHE"
def developers = [
[name: 'Andrew Taylor', email: 'ataylor@redtoad.ca']
]
def scm = [url: "http://github.com/ataylor284/spring-security-eventlog"]
def issueManagement = [system: 'GITHUB', url: "http://github.com/ataylor284/spring-security-eventlog/issues" ]
def doWithSpring = {
def eventLoggerClass = application.config.grails.plugin.springsecurity.eventlog.eventLogger ?: SpringSecurityEventLogger
springSecurityEventLogger(eventLoggerClass)
// normally these two beans are instantiated only if
// 'useSecurityEventListener' is true, but they're needed so
// we override the config
securityEventListener(SecurityEventListener)
authenticationEventPublisher(DefaultAuthenticationEventPublisher)
}
def doWithApplicationContext = { ctx ->
ctx.logoutHandlers << ctx.springSecurityEventLogger
}
}