领先一步
VMware 提供培训和认证,助您加速进步。
了解更多我谨代表社区,很高兴地宣布 Spring Security 5.2.0.M2 的发布!此版本包含 100 多项更新。您可以在下方找到亮点:
PKCE 不仅适用于原生或基于浏览器的应用,也适用于任何需要公开客户端的场景。Spring Security 5.2 为后端作为公开客户端进行身份验证提供了一种安全的方式。
JwtDecoderNimbusReactiveJwtDecoder 使用自定义处理器资源服务器现在支持第二个 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,以及一些其他的标头写入清理。