Spring Security 5.1 GA 正式釋出!
Spring 安全框架 Spring Security 5.1 GAofollow,noindex">現已正式釋出 !
POM
<dependencies> <!-- ... other dependency elements ... --> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-web</artifactId> <version>5.1.0.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-config</artifactId> <version>5.1.0.RELEASE</version> </dependency> </dependencies>
該版本關閉了50+ 的 issue ,此外,Spring Security 5.1 也提供了大量的新特性,值得關注的有:
Servlet
-
通過UserDetailsPasswordService 對密碼儲存進行自動升級
-
OAuth 2.0 Client
-
可自定義的授權和 Token 請求(Authorize and Token requests)
-
支援
authorization_code
grant -
支援
client_credentials
grant -
OAuth 2.0 資源伺服器 - 支援JWT-encoded bearer tokens
-
新增 OAuth2WebClient 整合
-
HTTP Firewall 可防止篡改 HTTP 動詞和跨站點跟蹤
-
ExceptionTranslationFilter 支援通過 RequestMatcher 選擇 AccessDeniedHandler
-
CSRF 支援排除某些請求
-
新增對特性策略(Feature Policy) 的支援
-
新增@Transient authentication tokens
-
預設登入頁面的現代化外觀
WebFlux
-
通過ReactiveUserDetailsPasswordService.html" target="_blank" rel="nofollow,noindex">ReactiveUserDetailsPasswordService 對密碼儲存進行自動升級
-
新增對OAuth2 的支援
-
新增對OAuth2 Client 的支援
-
新增對OAuth2 Resource Server 的支援
-
新增對 OAuth2WebClient 的整合
-
@WithUserDetails
現在可以和 ReactiveUserDetailsService 搭配使用 -
新增對CORS 的支援
-
新增對以下HTTP headers 的支援
-
支援對 beans 的解析
-
支援解析
errorOnInvalidType
Integrations
-
Jackson 支援 和 BadCredentialsException 一起搭配使用
-
@WithMockUser
支援 在測試中設定 SecurityContext 時進行自定義。例如,@WithMockUser(setupBefore = TestExecutionEvent.TEST_EXECUTION)
將在 JUnit 的 @Before 之後和測試執行之前對使用者進行設定 -
可以使用自定義環境變數配置LDAP/">LDAP 身份驗證" rel="nofollow,noindex">LDAP 身份驗證
-
X.509 身份驗證 支援將主體(principal)派生為策略
詳情請檢視https://docs.spring.io/spring-security/site/docs/5.1.0.RELEASE/reference/htmlsingle/#new
Spring Security 的前身是Acegi Security,是 Spring 專案組中用來提供安全認證服務的框架。
Spring Security 為基於 J2EE 企業應用軟體提供了全面安全服務。特別是使用領先的 J2EE 解決方案-Spring 框架開發的企業軟體專案。人們使用 Spring Security 有很多種原因,不過通常吸引他們的是在 J2EE Servlet 規範或 EJB 規範中找不到典型企業應用場景的解決方案。