You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Spring Security 5.8/6 supports delaying the lookup of the SecurityContext until an authorization rule requires it.
As such, it's preferred to use authorizeHttpRequests#permitAll over web.ignoring(). In the past web.ignoring() was added as a quick workaround to address the performance impact of looking up the SecurityContext on every request. Now, Spring Security defers that work until authorization-time and in the case of permitAll, no authorization is performed.
The behavior of the above application asks Spring Security to protect all endpoints other than /cloudfoundry.
As of Spring Security 5.7, this produces a warning that web.ignoring() is not recommended since this prevents Spring Security from using its WAF and writing secure HTTP response headers for those ignored endpoints.
Alternatively, the application can do the following:
Spring Security 5.8/6 supports delaying the lookup of the
SecurityContext
until an authorization rule requires it.As such, it's preferred to use
authorizeHttpRequests#permitAll
overweb.ignoring()
. In the pastweb.ignoring()
was added as a quick workaround to address the performance impact of looking up theSecurityContext
on every request. Now, Spring Security defers that work until authorization-time and in the case ofpermitAll
, no authorization is performed.Consider the following application:
The behavior of the above application asks Spring Security to protect all endpoints other than
/cloudfoundry
.As of Spring Security 5.7, this produces a warning that
web.ignoring()
is not recommended since this prevents Spring Security from using its WAF and writing secure HTTP response headers for those ignored endpoints.Alternatively, the application can do the following:
Or, if it should be considered entirely separate:
This has the additional benefit of removing Spring Security's warning message.
The text was updated successfully, but these errors were encountered: