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-Initiated Logout
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 社区所有即将举行的活动。

查看全部