Skip to content

Commit 804db8c

Browse files
committed
Add XML configuration guidance to deprecation warnings
When using XML-based Spring Security configuration, the standard <intercept-url> elements internally translate to the deprecated authorizeRequests mechanism, causing warnings that cannot be resolved by XML users. This change adds clarification to the deprecation warnings, informing XML users that: 1. The warning can be ignored for XML configurations 2. They should continue using standard <intercept-url> elements 3. The deprecation only affects Java/Kotlin configuration users This resolves the confusion for XML users who receive deprecation warnings despite using officially supported XML configuration. Closes gh-17259 Signed-off-by: khj68 <[email protected]>
1 parent 006f638 commit 804db8c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

config/src/main/java/org/springframework/security/config/http/DefaultFilterChainValidator.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,15 @@ private void checkAuthorizationFilters(List<SecurityFilterChain> chains) {
126126
}
127127
if (authorizationFilter != null && filterSecurityInterceptor != null) {
128128
this.logger.warn(
129-
"It is not recommended to use authorizeRequests or FilterSecurityInterceptor in the configuration. Please only use authorizeHttpRequests");
129+
"It is not recommended to use authorizeRequests or FilterSecurityInterceptor in the configuration. Please only use authorizeHttpRequests. "
130+
+ "Note: If using XML configuration, this warning can be ignored as XML <intercept-url> elements internally use the deprecated mechanism. "
131+
+ "XML users should continue using standard <intercept-url> configuration.");
130132
}
131133
if (filterSecurityInterceptor != null) {
132134
this.logger.warn(
133-
"Usage of authorizeRequests and FilterSecurityInterceptor are deprecated. Please use authorizeHttpRequests in the configuration");
135+
"Usage of authorizeRequests and FilterSecurityInterceptor are deprecated. Please use authorizeHttpRequests in the configuration. "
136+
+ "Note: If using XML configuration, this warning can be ignored as XML <intercept-url> elements internally use the deprecated mechanism. "
137+
+ "XML users should continue using standard <intercept-url> configuration.");
134138
}
135139
authorizationFilter = null;
136140
filterSecurityInterceptor = null;

0 commit comments

Comments
 (0)