Spring Security 5.2.0.M2 发布

发布 | Josh Cummings | 2019年4月16日 | ...

我谨代表社区,很高兴地宣布 Spring Security 5.2.0.M2 的发布!此版本包含 100 多项更新。您可以在下方找到亮点:

OAuth 2.0

gh-6446 - PKCE 客户端支持

PKCE 不仅适用于原生基于浏览器的应用,也适用于任何需要公开客户端的场景。Spring Security 5.2 为后端作为公开客户端进行身份验证提供了一种安全的方式。

gh-5350 - OpenID Connect RP 发起的注销
gh-5465 - 能够将对称密钥用于 JwtDecoder
gh-5397 - 允许 NimbusReactiveJwtDecoder 使用自定义处理器
gh-6513 & gh-5200 - 支持资源服务器令牌自省

资源服务器现在支持第二个 OAuth 2.0 令牌验证策略:令牌自省。当资源服务器需要或必须远程验证令牌时,这将非常方便。

gh-5351 - 支持资源服务器多租户(仅 Servlet)

通过引入 AuthenticationManagerResolver,初步支持多租户资源服务器已上线。

核心

gh-6494 - 将密钥材料转换为 Key 实例

Spring Security 5.2 通过向 ConversionService 注册 Converter 并向 PropertyEditorRegistry 注册 PropertyEditor,简化了将 X.509 和 PKCS#8 密钥材料转换为 RSAPublicKeyRSAPrivateKey 实例的过程。您可以在资源服务器静态密钥示例中找到一个示例。

gh-6774 - 支持 JDK 12
gh-6722 - 引入 AuthenticationManagerResolver
gh-6546 - 为方法参数引入 @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");
}

Web

gh-4187 - 支持 Clear-Site-Data 标头
gh-6312 - 支持 HSTS 预加载
gh-6453 - 引入 CompositeHeaderWriter,以及一些其他的标头写入清理

项目站点 | 参考 | 帮助

获取 Spring 新闻通讯

通过 Spring 新闻通讯保持联系

订阅

领先一步

VMware 提供培训和认证,助您加速进步。

了解更多

获得支持

Tanzu Spring 提供 OpenJDK™、Spring 和 Apache Tomcat® 的支持和二进制文件,只需一份简单的订阅。

了解更多

即将举行的活动

查看 Spring 社区所有即将举行的活动。

查看所有