領先一步
VMware 提供訓練和認證,加速您的進展。
了解更多我很高興代表社群宣布 Spring Security 5.2.0.M2 的發佈!此版本包含 100 多個更新。您可以在下方找到重點
PKCE 不僅適用於原生或基於瀏覽器的應用程式,也適用於任何我們想要擁有公開客戶端的時候。Spring Security 5.2 引入了一種安全的方式,讓後端可以作為公開客戶端進行身份驗證。
JwtDecoder
搭配使用NimbusReactiveJwtDecoder
能夠採用自訂的處理器資源伺服器現在支援第二種 OAuth 2.0 權杖驗證策略:權杖內省。當資源伺服器想要或必須遠端驗證權杖時,這非常方便。
隨著 AuthenticationManagerResolver
的引入,初步支援多租戶資源伺服器已經到來。
Key
實例Spring Security 5.2 透過將 Converter
註冊到 ConversionService
並將 PropertyEditor
註冊到 PropertyEditorRegistry
,簡化了將 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
,以及其他一些 header-writing 清理。