保持领先
VMware 提供培训和认证,助您快速提升。
了解更多我代表社区高兴地宣布 Spring Security 5.2.0.M2 发布了!此版本包括 100 多项更新。您可以在下面找到重点内容
PKCE 不仅适用于原生或基于浏览器的应用,也适用于任何我们想拥有公共客户端的场景。Spring Security 5.2 引入了一种安全的方式,让后端能够作为公共客户端进行认证。
JwtDecoder
的能力NimbusReactiveJwtDecoder
支持自定义处理器资源服务器现在支持第二种 OAuth 2.0 令牌验证策略:令牌自省。当资源服务器希望或必须远程验证令牌时,此功能非常有用。
随着 AuthenticationManagerResolver
的引入,对多租户资源服务器的初步支持已经到位。
Key
实例Spring Security 5.2 通过向 ConversionService
注册 Converter
并向 PropertyEditorRegistry
注册 PropertyEditor
,简化了将 X.509 和 PKCS#8 密钥材料转换为 RSAPublicKey
和 RSAPrivateKey
实例的过程。您可以在资源服务器静态密钥示例中找到一个示例。
AuthenticationManagerResolver
@CurrentSecurityContext
与之前的 @AuthenticationPrincipal
类似,@CurrentSecurityContext
与参数解析器配合使用,以检索 SecurityContext
的各个方面。
public String hello(@CurrentSecurityContext
SecurityContext context) {
return Optional.ofNullable(context.getAuthentication())
.map(Authentication::getName).orElse("world");
}
// or
public String hello(@CurrentSecurityContext
(expression="authentication.name") String name) {
return Optional.ofNullable(name).orElse("world");
}
CompositeHeaderWriter
,以及其他一些请求头写入清理工作。