Spring Security 5.2.0.M2 发布,Spring 安全框架

Spring Security 5.2.0.M2 已发布,该版本包含超过 100 处更新。下面说说值得关注的更新:

OAuth 2.0

  • 客户端支持 PKEC
  • OpenID 连接 RP-Initiated Logout

  • 能够使用 JwtDecoder 的对称密钥

  • NimbusReactiveJwtDecoder 能够采用自定义处理器

  • 支持资源服务器令牌自检

  • 支持资源服务器多租户(仅限 Servlet)

Core

  • 将密钥材料转换为密钥实例
  • 支持 JDK 12
  • 引入 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");
}

Web

  • 支持 Clear-Site-Data 标头
  • 支持 HSTS 预加载
  • 引入 CompositeHeaderWriter,以及其他一些 header-writing cleanup

详情可查看发布说明

下载地址:

Source code(zip)

Source code(tar.gz)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值