I'm using Spring Security Rest and the Grails Audit Logging plugin. Audit log records are being created with all the correct information except the actor
property is always saved with the defaultActor
value.
Below is my configuration. Does anyone have any ideas? What should I be looking for? Thanks in advance for your time.
ext.springSecurityRestVersion = '3.0.0.RC1'
dependencies {
...
compile "org.grails.plugins:spring-security-rest:${springSecurityRestVersion}"
compile "org.grails.plugins:spring-security-rest-gorm:${springSecurityRestVersion}"
compile 'org.grails.plugins:audit-logging:4.0.3'
...
}
grails.plugin.auditLog:
auditDomainClassName: "us.mycompany.api.AuditLogEvent"
logFullClassName: false
defaultActor: "mycompany"
grails.plugin.springsecurity:
userLookup.userDomainClassName: 'us.mycompany.api.Person'
userLookup.authorityJoinClassName: 'us.mycompany.api.PersonRole'
authority.className: 'us.mycompany.api.Role'
filterChain.chainMap:
#Stateless chain
- { pattern: '/**', filters: 'JOINED_FILTERS,-exceptionTranslationFilter,-authenticationProcessingFilter,-securityContextPersistenceFilter,-rememberMeAuthenticationFilter' }
rest.token:
storage.gorm.tokenDomainClassName: 'us.mycompany.api.AuthenticationToken'
validation:
useBearerToken: false
enableAnonymousAccess: true
As I debugged this, it seems like the springSecurityService
dependency in SpringSecurityRequestResolver
was null, so I had to explicitly wire SpringSecurityRequestResolver
in resources.groovy
.
I know that I shouldn't have to do that, but it did fix my problem, so this is at least a workaround.
import grails.plugins.orm.auditable.resolvers.SpringSecurityRequestResolver
beans = {
auditRequestResolver(SpringSecurityRequestResolver) {
springSecurityService = ref('springSecurityService')
}
}