Deprecated API
Contents
-
Terminally Deprecated ElementsElementDescriptionFor removal in 7.0. Use
HeadersConfigurer.permissionsPolicyHeader(Customizer)
insteadorg.springframework.security.config.web.server.ServerHttpSecurity.HeaderSpec.FeaturePolicySpec.and()For removal in 7.0. Use#featurePolicy(Customizer)
insteadUseOidcUserService.setRetrieveUserInfo(Predicate)
insteadPlease useSpringOpaqueTokenIntrospector.Builder
Permit access to theDispatcherType
instead.@Configuration @EnableWebSecurity public class SecurityConfig { @Bean public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception { http .authorizeHttpRequests((authorize) -> authorize .dispatcherTypeMatchers(DispatcherType.ERROR).permitAll() // ... ); return http.build(); } }
This existed for an old IE bug and is no longer need.This existed for an old IE bug and is no longer need.This is deprecated for removal. Users can compareDefaultSavedRequest.getRedirectUrl()
to theHttpServletRequest
URL instead.LobHandler
is deprecated without replacement, as such this method will also be removed without replacement
-
Deprecated InterfacesInterfaceDescriptionUse
AuthorizationManager
insteadUseAuthorizationManager
insteadUse delegation withAuthorizationManager
Used only by now-deprecated classes. ConsiderSecuredAuthorizationManager
for `@Secured` methods.In modern Spring Security APIs, each API manages its own configuration context. As such there is no direct replacement for this interface. In the case of method security, please seeSecurityAnnotationScanner
andAuthorizationManager
. In the case of channel security, please seeHttpsRedirectFilter
. In the case of web security, please seeAuthorizationManager
.Use delegation withAuthorizationManager
This class will be removed from the public API. Please either use `spring-security-aspects`, Spring Security's method security support or create your own class that uses Spring AOP annotations.Authentication is now separated from authorization in Spring Security. This class is only used by now-deprecated components. There is not yet an equivalent replacement in Spring Security.Use theuse-authorization-manager
attribute for<method-security>
and<intercept-methods>
instead or use annotation-based orAuthorizationManager
-based authorizationUseAuthorizationManagerAfterMethodInterceptor
insteadUseAuthorizationManagerAfterMethodInterceptor
insteadUseAuthorizationManagerBeforeMethodInterceptor
insteadUseAuthorizationManagerBeforeMethodInterceptor
insteadUse delegation withAuthorizationManager
In modern Spring Security APIs, each API manages its own configuration context. As such there is no direct replacement for this interface. In the case of method security, please seeSecurityAnnotationScanner
andAuthorizationManager
. In the case of channel security, please seeHttpsRedirectFilter
. In the case of web security, please seeAuthorizationManager
.UseMessageMatcherDelegatingAuthorizationManager
insteadPlease useSaml2AssertionAuthentication.getRelyingPartyRegistrationId()
andSaml2ResponseAssertionAccessor
insteadno replacement is planned, though consider using a customRequestMatcher
for any sophisticated decision-makingplease useHttpsRedirectFilter
and its associatedPortMapper
no replacement is planned, though consider using a customRequestMatcher
for any sophisticated decision-makingIn modern Spring Security APIs, each API manages its own configuration context. As such there is no direct replacement for this interface. In the case of method security, please seeSecurityAnnotationScanner
andAuthorizationManager
. In the case of channel security, please seeHttpsRedirectFilter
. In the case of web security, please seeAuthorizationManager
.ALLOW-FROM is an obsolete directive that no longer works in modern browsers. Instead use Content-Security-Policy with the frame-ancestors directive.This existed for an old IE bug and is no longer need.
-
Deprecated ClassesClassDescriptionUse
Jsr250AuthorizationManager
insteadUseJsr250AuthorizationManager
insteadAuthorization events have moved. ConsiderAuthorizationGrantedEvent
andAuthorizationDeniedEvent
Authentication is now separated from authorization. ConsiderAbstractAuthenticationFailureEvent
instead.UseAuthorizationDeniedEvent
insteadUseAuthorizationGrantedEvent
insteadLogging is now embedded in Spring Security components. If you need further logging, please consider using your ownApplicationListener
Only used by now-deprecated classes. ConsiderEventObject.getSource()
to deduce public invocations.UseAuthorizationManager
interceptors insteadUseAuthorizationManagerAfterMethodInterceptor
insteadUseAuthorizationManagerAfterMethodInterceptor
insteadUseAuthorizationFilter
instead for filter security,AuthorizationChannelInterceptor
for messaging security, orAuthorizationManagerBeforeMethodInterceptor
andAuthorizationManagerAfterMethodInterceptor
for method security.Use delegation withAuthorizationManager
Please useAuthorizationManagerBeforeMethodInterceptor
andAuthorizationManagerAfterMethodInterceptor
insteadUseEnableMethodSecurity
or publish interceptors directlyThis class will be removed from the public API. Please either use `spring-security-aspects`, Spring Security's method security support or create your own class that uses Spring AOP annotations.This class will be removed from the public API. See `JoinPointMethodInvocation` in `spring-security-aspects` for its replacementUse delegation withAuthorizationManager
UseAuthorizationManager
insteadAuthentication is now separated from authorization in Spring Security. This class is only used by now-deprecated components. There is not yet an equivalent replacement in Spring Security.Authentication is now separated from authorization in Spring Security. This class is only used by now-deprecated components. There is not yet an equivalent replacement in Spring Security.Authentication is now separated from authorization in Spring Security. This class is only used by now-deprecated components. There is not yet an equivalent replacement in Spring Security.Use theuse-authorization-manager
attribute for<method-security>
and<intercept-methods>
instead or use annotation-based orAuthorizationManager
-based authorizationUse theuse-authorization-manager
attribute for<method-security>
and<intercept-methods>
instead or use annotation-based orAuthorizationManager
-based authorizationUse theuse-authorization-manager
attribute for<method-security>
and<intercept-methods>
instead or use annotation-based orAuthorizationManager
-based authorizationUse theuse-authorization-manager
attribute for<method-security>
and<intercept-methods>
instead or use annotation-based orAuthorizationManager
-based authorizationUseAuthorizationManagerAfterMethodInterceptor
insteadUseAuthorizationManagerBeforeMethodInterceptor
insteadUsePreAuthorizeAuthorizationManager
andPostAuthorizeAuthorizationManager
insteadIn modern Spring Security APIs, each API manages its own configuration context. As such there is no direct replacement for this interface. In the case of method security, please seeSecurityAnnotationScanner
andAuthorizationManager
. In the case of channel security, please seeHttpsRedirectFilter
. In the case of web security, please seeAuthorizationManager
.UseAuthorizationManager
insteadNow used by only-deprecated classes. Generally speaking, in-memory ACL is no longer advised, so no replacement is planned at this point.UseAuthorizationManager
insteadUseAuthorityAuthorizationManager
insteadUseAuthorizationManager
insteadUseAuthorityAuthorizationManager
insteadUseAuthorizationManager
insteadplease useAclPermissionEvaluator
instead. Spring Method Security annotations may also prove useful, for example@PreAuthorize("hasPermission(#id, ObjectsReturnType.class, read)")
please useAclPermissionEvaluator
instead. Spring Method Security annotations may also prove useful, for example@PostAuthorize("hasPermission(filterObject, read)")
org.springframework.security.acls.afterinvocation.AclEntryAfterInvocationCollectionFilteringProviderplease useAclPermissionEvaluator
instead. Spring Method Security annotations may also prove useful, for example@PostFilter("hasPermission(filterObject, read)")
please useAclPermissionEvaluator
instead. Spring Method Security annotations may also prove useful, for example@PostAuthorize("hasPermission(filterObject, read)")
UsePrePostMethodSecurityConfiguration
,SecuredMethodSecurityConfiguration
, orJsr250MethodSecurityConfiguration
insteadIn modern Spring Security APIs, each API manages its own configuration context. As such there is no direct replacement for this interface. In the case of method security, please seeSecurityAnnotationScanner
andAuthorizationManager
. In the case of channel security, please seeHttpsRedirectFilter
. In the case of web security, please seeAuthorizationManager
.please useHttpsRedirectConfigurer
insteadno replacement plannedno replacement plannedsee Certificate and Public Key Pinning for more contextorg.springframework.security.config.annotation.web.servlet.configuration.WebMvcSecurityConfigurationThis is applied internally using SpringWebMvcImportSelectorIn modern Spring Security APIs, each API manages its own configuration context. As such there is no direct replacement for this interface. In the case of method security, please seeSecurityAnnotationScanner
andAuthorizationManager
. In the case of channel security, please seeHttpsRedirectFilter
. In the case of web security, please seeAuthorizationManager
.Use `use-authorization-manager` property insteadUseMethodSecurityBeanDefinitionParser
insteadUse<intercept-methods>
,<method-security>
, or@EnableMethodSecurity
Digest based password encoding is not considered secure. Instead use an adaptive one way function like BCryptPasswordEncoder, Pbkdf2PasswordEncoder, or SCryptPasswordEncoder. Even better useDelegatingPasswordEncoder
which supports password upgrades. There are no plans to remove this support. It is deprecated to indicate that this is a legacy implementation and using it is considered insecure.Digest based password encoding is not considered secure. Instead use an adaptive one way function like BCryptPasswordEncoder, Pbkdf2PasswordEncoder, or SCryptPasswordEncoder. Even better useDelegatingPasswordEncoder
which supports password upgrades. There are no plans to remove this support. It is deprecated to indicate that this is a legacy implementation and using it is considered insecure.Digest based password encoding is not considered secure. Instead use an adaptive one way function like BCryptPasswordEncoder, Pbkdf2PasswordEncoder, or SCryptPasswordEncoder. Even better useDelegatingPasswordEncoder
which supports password upgrades. There are no plans to remove this support. It is deprecated to indicate that this is a legacy implementation and using it is considered insecure.This PasswordEncoder is not secure. Instead use an adaptive one way function like BCryptPasswordEncoder, Pbkdf2PasswordEncoder, or SCryptPasswordEncoder. Even better useDelegatingPasswordEncoder
which supports password upgrades. There are no plans to remove this support. It is deprecated to indicate that this is a legacy implementation and using it is considered insecure.Digest based password encoding is not considered secure. Instead use an adaptive one way function like BCryptPasswordEncoder, Pbkdf2PasswordEncoder, or SCryptPasswordEncoder. Even better useDelegatingPasswordEncoder
which supports password upgrades. There are no plans to remove this support. It is deprecated to indicate that this is a legacy implementation and using it is considered insecure.UseMessageMatcherDelegatingAuthorizationManager
insteadUseMessageMatcherDelegatingAuthorizationManager
insteadUseAuthorizationChannelInterceptor
insteadUseMessageMatcherDelegatingAuthorizationManager
insteadplease useAuthenticationPayloadExchangeConverter
insteadplease useAuthenticationPayloadExchangeConverter
insteadBasic Authentication did not evolve into a standard. Use Simple Authentication instead.Basic Authentication did not evolve into a standard. useSimpleAuthenticationEncoder
Please useSaml2ResponseAssertionAccessor
Please useRequestMatcherMetadataResponseResolver
please useHttpsRedirectFilter
and its associatedPortMapper
no replacement is planned, though consider using a customRequestMatcher
for any sophisticated decision-makingno replacement is planned, though consider using a customRequestMatcher
for any sophisticated decision-makingplease useHttpsRedirectFilter
and its associatedPortMapper
please useHttpsRedirectFilter
and its associatedPortMapper
no replacement is planned, though consider using a customRequestMatcher
for any sophisticated decision-makingIn modern Spring Security APIs, each API manages its own configuration context. As such there is no direct replacement for this interface. In the case of method security, please seeSecurityAnnotationScanner
andAuthorizationManager
. In the case of channel security, please seeHttpsRedirectFilter
. In the case of web security, please seeAuthorizationManager
.UseWebExpressionAuthorizationManager
insteadIn modern Spring Security APIs, each API manages its own configuration context. As such there is no direct replacement for this interface. In the case of method security, please seeSecurityAnnotationScanner
andAuthorizationManager
. In the case of channel security, please seeHttpsRedirectFilter
. In the case of web security, please seeAuthorizationManager
.UseAuthorizationFilter
insteadplease useAuthorizationManagerWebInvocationPrivilegeEvaluator
and adapt any delegateWebInvocationPrivilegeEvaluator
s intoAuthorizationManager
sPlease useSubjectX500PrincipalExtractor
insteadUseAuthenticationPrincipalArgumentResolver
instead.ALLOW-FROM is an obsolete directive that no longer works in modern browsers. Instead use Content-Security-Policy with the frame-ancestors directive.ALLOW-FROM is an obsolete directive that no longer works in modern browsers. Instead use Content-Security-Policy with the frame-ancestors directive.ALLOW-FROM is an obsolete directive that no longer works in modern browsers. Instead use Content-Security-Policy with the frame-ancestors directive.ALLOW-FROM is an obsolete directive that no longer works in modern browsers. Instead use Content-Security-Policy with the frame-ancestors directive.see Certificate and Public Key Pinning for more contextThis existed for an old IE bug and is no longer need.useServerFormLoginAuthenticationConverter
instead.UseServerHttpBasicAuthenticationConverter
instead.
-
Deprecated Annotation InterfacesAnnotation InterfaceDescriptionuse @{code org.springframework.security.core.parameters.P}Use
EnableMethodSecurity
insteadUseAuthenticationPrincipal
instead.
-
Deprecated FieldsFieldDescriptionsince 5.4 in favor of
AbstractMessageMatcherComposite.logger
The SHA-1 algorithm has been proven to be vulnerable to collision attacks and should not be used. See the Google Security Blog for more info.Basic did not evolve into the standard. Instead use Simple Authentication MimeTypeUtils.parseMimeType(WellKnownMimeType.MESSAGE_RSOCKET_AUTHENTICATION.getString())Basic did not evolve into the standard. Instead use Simple Authentication MimeTypeUtils.parseMimeType(WellKnownMimeType.MESSAGE_RSOCKET_AUTHENTICATION.getString())
-
Deprecated MethodsMethodDescriptionplease see
RoleHierarchyImpl#setHierarchy
deprecation noticeplease provide all advisors in the constructorPermit access to theDispatcherType
instead.@Configuration @EnableWebSecurity public class SecurityConfig { @Bean public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception { http .authorizeHttpRequests((authorize) -> authorize .dispatcherTypeMatchers(DispatcherType.ERROR).permitAll() // ... ); return http.build(); } }
For removal in 7.0. UseHeadersConfigurer.permissionsPolicy(Customizer)
orpermissionsPolicy(Customizer.withDefaults())
to stick with defaults. See the documentation for more details.see Certificate and Public Key Pinning for more contextFor removal in 7.0. UseHeadersConfigurer.permissionsPolicyHeader(Customizer)
insteadUse this.context insteadPlease use {X509Configurer.x509PrincipalExtractor(X509PrincipalExtractor)
insteadFor removal in 7.0. UseServerHttpSecurity.HeaderSpec.permissionsPolicy(Customizer)
instead.org.springframework.security.config.web.server.ServerHttpSecurity.HeaderSpec.FeaturePolicySpec.and()For removal in 7.0. Use#featurePolicy(Customizer)
insteadUsing this method is not considered safe for production, but is acceptable for demos and getting started. For production purposes, ensure the password is encoded externally. See the method Javadoc for additional details. There are no plans to remove this support. It is deprecated to indicate that this is considered insecure for production purposes.UseOidcUserService.setRetrieveUserInfo(Predicate)
insteadPlease provide anAuthenticationConverter
in the constructor and set theAuthenticationDetailsSource
there instead. For example, you can useBearerTokenAuthenticationConverter.setAuthenticationDetailsSource(org.springframework.security.authentication.AuthenticationDetailsSource<jakarta.servlet.http.HttpServletRequest, ?>)
Please provide anAuthenticationConverter
in the constructor insteadPermit access to theDispatcherType
instead.@Configuration @EnableWebSecurity public class SecurityConfig { @Bean public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception { http .authorizeHttpRequests((authorize) -> authorize .dispatcherTypeMatchers(DispatcherType.ERROR).permitAll() // ... ); return http.build(); } }
UseStrictHttpFirewall.getEncodedUrlBlocklist()
insteadThis is deprecated for removal. Users can compareDefaultSavedRequest.getRedirectUrl()
to theHttpServletRequest
URL instead.As of 5.1 in favor ofAuthenticationWebFilter.setServerAuthenticationConverter(ServerAuthenticationConverter)
LobHandler
is deprecated without replacement, as such this method will also be removed without replacement
-
Deprecated ConstructorsConstructorDescriptionPlease use
SpringOpaqueTokenIntrospector.Builder
UseBuilder(RelyingPartyRegistration)
insteadALLOW-FROM is an obsolete directive that no longer works in modern browsers. Instead use Content-Security-Policy with the frame-ancestors directive.
-
Deprecated Enum ConstantsEnum ConstantDescriptionplease see
PayloadInterceptorOrder.AUTHENTICATION
please seePayloadInterceptorOrder.AUTHENTICATION
ALLOW-FROM is an obsolete directive that no longer works in modern browsers. Instead use Content-Security-Policy with the frame-ancestors directive.
DispatcherType
instead.