-
Notifications
You must be signed in to change notification settings - Fork 223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SpringSecurityService and tags not working because SCH.getContext().getAuthentication() is null #1026
Comments
Seems like a Spring Boot issue
|
those messages are incorrect because the filter is correctly registered. I isolated the issue in that it occurs only inside a template. It works everywhere else This is not a bug with the plugin, but rather a bug in the filter order of when layouts get rendered. |
Fixed: Requires running the sitemesh filter after the Spring Security filter chain so the security context is not cleared before the pages is decorated and then making sure Grails triggers buffering by passing the correctly wrapped HttpServletResponse object. Buffering is triggered when response.setContentType() is called. All that is required is running the latest Grails Sitemesh 3 plugin snapshot. |
Moving the sitemesh filter after security was not best path forward because it ends up with access denied page not being decorated. I came up with a new approach of registering a second site mesh filter inside the filter chain. It currently requires adding the registration to
|
After authenticating,
springSecurityService.isLoggedIn()
is false becauseSCH.getContext().getAuthentication() == null
org.springframework.security.core.context.SecurityContextHolder
The text was updated successfully, but these errors were encountered: