对于最新的稳定版本,请使用 Spring Security 6.4.1! |
Spring Security 6.0 中的新增功能
Spring Security 6.0 提供了许多新功能。 以下是该版本的亮点。
重大更改
-
gh-8980 - 删除 unsafe/已弃用
Encryptors.querableText(CharSequence,CharSequence)
. 而是使用数据存储来加密值。 -
gh-11520 - 记住我默认使用 SHA256
-
gh-8819 - 将过滤器移动到 Web 包 重新组织导入
-
gh-7349 - 将筛选器和令牌移动到适当的软件包 重新组织导入
-
gh-11026 - 用途
RequestAttributeSecurityContextRepository
而不是NullSecurityContextRepository
-
gh-11827 - 更改 的默认权限
oauth2Login()
-
GH-10347 - 删除
UsernamePasswordAuthenticationToken
登记BasicAuthenticationFilter
-
gh-11923 - 删除
WebSecurityConfigurerAdapter
. 相反,请创建一个SecurityFilterChain Bean。 -
gh-11899 - 用途
MvcRequestMatcher
如果存在 Spring MVC,则默认为。 您可以配置不同的RequestMatcher
通过使用 <http> 中的 request-matcher 属性。 -
将 use-authorization-manager=“true” 更改为默认值 如果应用程序使用
use-expressions="true"
或access-decision-manager-ref
切换到use-expressions="false"
或authorization-manager-ref
分别。 如果 application 依赖于隐式的<intercept-url pattern="/**" access="permitAll"/>
,这不再是隐式的,需要指定。 或使用use-authorization-manager="false"
-
gh-11939 - 删除已弃用
antMatchers
,mvcMatchers
,regexMatchers
Java 配置中的 helper 方法。 相反,请使用requestMatchers
或HttpSecurity#securityMatchers
. -
gh-11985 - 删除
Argon2PasswordEncoder
,SCryptPasswordEncoder
和Pbkdf2PasswordEncoder
. -
gh-12019 - 删除已弃用的方法
setTokenFromMultipartDataEnabled
从CsrfWebFilter
-
gh-12020 - 删除已弃用的方法
tokenFromMultipartDataEnabled
从 Java 配置 -
GH-9429 系列 -
Authentication(Web)Filter
重新引发 'AuthenticationServiceException 的 -
gh-11110 - 默认情况下需要显式会话保存
-
GH-11057 - 删除
MessageSourceAware
从ExceptionTranslationWebFilter
-
gh-12202 - 删除 OAuth 弃用
-
gh-10556 - 删除 EOL OpenSaml 3 支持。 请改用 OpenSaml 4 支持。
-
gh-11077 - 删除 SAML 弃用
-
删除
Converter
constructors 从Saml2MetadataFilter
和Saml2AuthenticationTokenConverter
-
删除
Saml2AuthenticationRequestContextResolver
和Saml2AuthenticationRequestFactory
和实现 -
删除
Saml2AuthenticationToken(String, String, String, String, List)
-
删除
RelyingPartyRegistration.ProviderDetails
和相关方法 -
删除
OpenSamlAuthenticationProvider
-
-
gh-12180 - 注册
FilterChainProxy
适用于所有 Dispatcher 类型
LDAP 协议
-
gh-9276 - 对 LdapAuthoritiesPopulator 进行后处理
Web
-
GH-11432 系列 -
CookieServerCsrfTokenRepository
支持 Maxage