user
06/26/2025, 2:34 PM/process/object
which works fine without any auth, and by default my filterChain in application.groovy
looks like this
grails.plugin.springsecurity.filterChain.chainMap = [
[pattern: '/**', filters: 'JOINED_FILTERS']
]
Now, I have defined a new filter called tokenAuthenticationFilter
by extending OncePerRequestFilter
and I am registering this filter under application.groovy like
grails.plugin.springsecurity.filterChain.filterNames = ['tokenAuthenticationFilter']
grails.plugin.springsecurity.filterChain.chainMap = [
[pattern: '/**', filters: 'JOINED_FILTERS,-tokenAuthenticationFilter']
]
As soon as I do this, I get the below chain of exceptions,
2025-06-26 15:32:54.366 [http-nio-8080-exec-1] ERROR o.a.c.c.C.[.[.[.[dispatcherServletRegistration] - Servlet.service() for servlet [dispatcherServletRegistration] in context with path [] threw exception
org.springframework.security.authentication.AuthenticationCredentialsNotFoundException: An Authentication object was not found in the SecurityContext
at org.springframework.security.access.intercept.AbstractSecurityInterceptor.credentialsNotFound(AbstractSecurityInterceptor.java:350)
at org.springframework.security.access.intercept.AbstractSecurityInterceptor.beforeInvocation(AbstractSecurityInterceptor.java:214)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:115)
How can I explicity disable Auth for this? All I have done is introduce a new filterJames Fredley
06/26/2025, 3:26 PMuser
06/26/2025, 3:35 PM