-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
WebInvocationPrivilegeEvaluator does not provide a way to pass a ServletContext #10208
Labels
in: web
An issue in web modules (web, webmvc)
status: backported
An issue that has been backported to maintenance branches
type: bug
A general bug
Milestone
Comments
philwebb
added
status: waiting-for-triage
An issue we've not yet triaged
type: bug
A general bug
labels
Aug 17, 2021
Discussing this issue today on our call and @wilkinsona suggested another fix might be to make the |
marcusdacoregio
added
in: web
An issue in web modules (web, webmvc)
and removed
status: waiting-for-triage
An issue we've not yet triaged
labels
Aug 19, 2021
Also, @rwinch suggested that we can allow |
marcusdacoregio
added a commit
to marcusdacoregio/spring-security
that referenced
this issue
Aug 31, 2021
marcusdacoregio
added a commit
that referenced
this issue
Oct 14, 2021
marcusdacoregio
added a commit
that referenced
this issue
Oct 22, 2021
spring-projects-issues
added
the
status: backported
An issue that has been backported to maintenance branches
label
Oct 22, 2021
marcusdacoregio
added a commit
to marcusdacoregio/spring-security
that referenced
this issue
Oct 22, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
in: web
An issue in web modules (web, webmvc)
status: backported
An issue that has been backported to maintenance branches
type: bug
A general bug
Describe the bug
See spring-projects/spring-boot#27728 for background.
When using the following Thymeleaf markup:
The following exception is thrown if the
getServletContext
is called on the request.I think this is because this Thymeleaf code uses a
WebInvocationPrivilegeEvaluator
to determine if path can be used. TheWebInvocationPrivilegeEvaluator
creates aDummyRequest
which throws the error.To Reproduce
Run https://github.com/tvahrst/springboot-security-thymeleaf and hit
localhost:8080/main
Expected behavior
Thymeleaf has a
IWebContext
which has access toServletContext
. IfWebInvocationPrivilegeEvaluator
has aisAllowed
method that could accept the context then it could be passed along.Alternatively, there's a
WebAttributes.WEB_INVOCATION_PRIVILEGE_EVALUATOR_ATTRIBUTE
which Thymleaf checks. Spring Security could add this attribute with theServletContext
propagated from the request.Sample
https://github.com/tvahrst/springboot-security-thymeleaf
The text was updated successfully, but these errors were encountered: