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 透過將 Converter 註冊到 ConversionService 並將 PropertyEditor 註冊到 PropertyEditorRegistry,簡化了將 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");
}

網路

gh-4187 - 支援 Clear-Site-Data 標頭
gh-6312 - 支援 HSTS preload
gh-6453 - 導入 CompositeHeaderWriter,以及其他一些 header-writing 清理

專案網站 | 參考文件 | 求助

取得 Spring 電子報

隨時掌握 Spring 電子報

訂閱

領先一步

VMware 提供訓練和認證,加速您的進展。

了解更多

取得支援

Tanzu Spring 在一個簡單的訂閱中提供 OpenJDK™、Spring 和 Apache Tomcat® 的支援和二進位檔案。

了解更多

即將到來的活動

查看 Spring 社群中所有即將到來的活動。

查看全部