Skip to content
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

Improve Integration with Spring Security #140

Open
codeconsole opened this issue Oct 6, 2024 · 0 comments
Open

Improve Integration with Spring Security #140

codeconsole opened this issue Oct 6, 2024 · 0 comments

Comments

@codeconsole
Copy link
Member

Decorators are rendered upon completion of the servlet filterChain and returning back up to the Sitemesh filter. The correct placement of the Sitemesh filter is in a position before any possible content rendering so that it could be buffered for processing.

The issue with Spring Security is its own filterChain.

If the security context is needed inside a decorator it will not be available if the Sitemesh filter I registered prior to the execution of SecurityContextPersistenceFilter because it is cleared when the filter completes. This can be solved by registering the Sitemesh filter immediately after the Spring Security filterChain.

However, if the Sitemesh filter is registered after the Spring Security filterChain and a user tries to access a protected page, the Sitemesh filter is bypassed and the not authorized error page is not decorated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant