You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/modules/ROOT/pages/servlet/authorization/method-security.adoc
+2
Original file line number
Diff line number
Diff line change
@@ -1528,6 +1528,7 @@ We expose `MethodSecurityExpressionHandler` using a `static` method to ensure th
1528
1528
1529
1529
You can also <<subclass-defaultmethodsecurityexpressionhandler,subclass `DefaultMessageSecurityExpressionHandler`>> to add your own custom authorization expressions beyond the defaults.
1530
1530
1531
+
[[pre-post-authorize-aot]]
1531
1532
=== Working with AOT
1532
1533
1533
1534
Spring Security will scan all beans in the application context for methods that use `@PreAuthorize` or `@PostAuthorize`.
@@ -2462,6 +2463,7 @@ And if they do have that authority, they'll see:
2462
2463
You can also add the Spring Boot property `spring.jackson.default-property-inclusion=non_null` to exclude the null value from serialization, if you also don't want to reveal the JSON key to an unauthorized user.
2463
2464
====
2464
2465
2466
+
[[authorize-return-object-aot]]
2465
2467
=== Working with AOT
2466
2468
2467
2469
Spring Security will scan all beans in the application context for methods that use `@AuthorizeReturnObject`.
Copy file name to clipboardExpand all lines: docs/modules/ROOT/pages/whats-new.adoc
+119-9
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,89 @@
4
4
Spring Security 6.4 provides a number of new features.
5
5
Below are the highlights of the release, or you can view https://github.com/spring-projects/spring-security/releases[the release notes] for a detailed listing of each feature and bug fix.
6
6
7
+
== Deprecation Notices
8
+
9
+
As we get closer to Spring Security 7, it's important to stay up to date on deprecations.
10
+
As such, this section points out deprecations in the 6.4 release.
11
+
12
+
* *Method Security* - `AuthorizationManager#check` is deprecated in favor of `AuthorizationManager#authorize`.
13
+
This is primarily to allow the return type to be an interface instead of a concrete class.
14
+
If you are invoking `AuthorizationManager#check`, please invoke `AuthorizationManager#authorize` instead.
15
+
+
16
+
Relatedly, `AuthorizationEventPublisher#publishEvent` that takes an `AuthorizationDecision` is deprecated in favor of a method of the same name that takes an `AuthorizationResult` interface instead.
17
+
* *Method Security* - `PrePostTemplateDefaults` is deprecated in favor of the more generic `AnnotationTemplateExpressionDefaults` as there is now meta-annotation property support for `@AuthenticationPrincipal` and `@CurrentSecurityContext` as well.
18
+
If you are constructing a `PrePostTemplateDefaults`, change this out for an `AnnotationTemplateExpressionDefaults`.
19
+
* *OAuth 2.0* - `NimbusOpaqueTokenIntrospector` has been deprecated in favor of `SpringOpaqueTokenIntrospector` in order to remove Spring Security OAuth 2.0 Resource Server's reliance on the `oidc-oauth2-sdk` package.
20
+
If you are constructing a `NimbusOpaqueTokenIntrospector`, replace it with ``SpringOpaqueTokenIntrospector``'s constructor
21
+
* *OAuth 2.0* - `DefaultAuthorizationCodeTokenResponseClient`, `DefaultClientCredentialsTokenResponseClient`, `DefaultJwtBearerTokenResponseClient`, `DefaultPasswordTokenResponseClient`, `DefaultRefreshTokenTokenResponseClient`, and `DefaultTokenExchangeTokenResponseClient` are deprecated in favor of their `RestClient` equivalents.
22
+
+
23
+
Relatedly,`JwtBearerGrantRequestEntityConverter`, `OAuth2AuthorizationCodeGrantRequestEntityConverter`, `OAuth2ClientCredentialsGrantRequestEntityConverter`, `OAuth2PasswordGrantRequestEntityConverter`, `OAuth2RefreshTokenGrantRequestEntityConverter` are deprecated in favor of providing an instance of `DefaultOAuth2TokenRequestParametersConverter` to one of the above token response clients
24
+
+
25
+
For example, if you have the following arrangement:
* *SAML 2.0* - Unversioned OpenSAML implementations of Spring Security SAML 2.0 Service Provider's interfaces have been deprecated in favor of versioned ones.
77
+
For example, `OpenSamlAuthenticationTokenConverter` is now replaced by `OpenSaml4AuthenticationTokenConverter` and `OpenSaml5AuthenticationTokenConverter`.
78
+
If you are constructing one of these deprecated versions, please replace it with the one that corresponds to the OpenSAML version you are using.
79
+
* *SAML 2.0* - Methods surrounding `AssertingPartyDetails` are deprecated in favor of equivalent methods that use the `AssertingPartyMetadata` interface.
80
+
* *LDAP* - Usages of `DistinguishedName` are now deprecated in order to align with Spring LDAP's deprecations
81
+
82
+
== One-Time Token Login
83
+
84
+
* Spring Security now xref:servlet/authentication/onetimetoken.adoc[supports One-Time Token Login] via the `oneTimeTokenLogin()` DSL, including xref:servlet/authentication/onetimetoken.adoc#customize-generate-consume-token[JDBC support].
85
+
86
+
== Passkeys
87
+
88
+
Spring Security now has xref:servlet/authentication/passkeys.adoc[Passkeys] support.
89
+
7
90
== Method Security
8
91
9
92
* All xref:servlet/authorization/method-security.adoc#meta-annotations[method security annotations] now support {spring-framework-api-url}org/springframework/core/annotation/AliasFor.html[Framework's `@AliasFor`]
@@ -48,10 +131,14 @@ fun method(@CurrentUsername("username") val username: String): String {
48
131
======
49
132
* https://github.com/spring-projects/spring-security/issues/13490[Several] https://github.com/spring-projects/spring-security/issues/13234[improvements] https://github.com/spring-projects/spring-security/issues/15097[were made] to align Security's annotation search with ``AbstractFallbackMethodSecurityMetadataSource``'s algorithm.
50
133
This aids in migration from earlier versions of Spring Security.
134
+
* Native applications can now xref:servlet/authorization/method-security.adoc#authorize-return-object-aot[use `@AuthorizeReturnObject`]
135
+
* Native applications can now xref:servlet/authorization/method-security.adoc#pre-post-authorize-aot[reference beans in `@PreAuthorize` and `@PostAuthorize`]
136
+
* `SecurityAnnotationScanners` offers https://github.com/spring-projects/spring-security/issues/15700[a convenient API] for scanning for Security annotations and for adding Security's selection and templating features to custom annotations
51
137
52
138
== OAuth 2.0
53
139
54
140
* `oauth2Login()` now accepts https://github.com/spring-projects/spring-security/pull/15237[`OAuth2AuthorizationRequestResolver` as a `@Bean`]
141
+
* `ClientRegistrations` now supports externally obtained configuration
55
142
* Added `loginPage()` to DSL in reactive `oauth2Login()`
56
143
* OIDC Back-Channel support now accepts https://github.com/spring-projects/spring-security/issues/15003[logout tokens of type `logout+jwt`]
57
144
* `RestClient` can now be xref:servlet/oauth2/index.adoc#oauth2-client-access-protected-resources[configured] with `OAuth2ClientHttpRequestInterceptor` to xref:servlet/oauth2/index.adoc#oauth2-client-accessing-protected-resources-example[make protected resources requests]
@@ -131,7 +218,7 @@ class SecurityConfig {
131
218
}
132
219
----
133
220
======
134
-
* Deprecated `Default*` implementations of `OAuth2AccessTokenResponseClient`
221
+
* Token Exchange now https://github.com/spring-projects/spring-security/issues/15534[supports refresh tokens]
135
222
136
223
== SAML 2.0
137
224
@@ -197,15 +284,15 @@ This implementation also supports the validation of a metadata's signature.
197
284
* You can now sign https://github.com/spring-projects/spring-security/pull/14916[relying party metadata]
198
285
* `RelyingPartyRegistrationRepository` results can now be javadoc:org.springframework.security.saml2.provider.service.registration.CachingRelyingPartyRegistrationRepository[cached].
199
286
This is helpful if you want to defer the loading of the registration values til after application startup.
200
-
It is also helpful if you want to control when metadata gets refreshed.
287
+
It is also helpful if you want to control when metadata gets refreshed via Spring Cache.
201
288
* To align with the SAML 2.0 standard, the metadata endpoint now https://github.com/spring-projects/spring-security/issues/15147[uses the `application/samlmetadata+xml` MIME type]
202
289
203
290
== Web
204
291
205
292
* CSRF BREACH tokens are now https://github.com/spring-projects/spring-security/issues/15187[more consistent]
206
293
* The Remember Me cookie now is https://github.com/spring-projects/spring-security/pull/15203[more customizable]
207
-
* Security Filter Chain is now improved.
208
-
Specifically, the following arrangement is invalid since an anyrequest filter chain comes before all other filter chains:
294
+
* Security Filter Chain finds more invalid configurations.
295
+
For example, a filter chain declared after an any-request filter chain is invalid since it will never be invoked:
@@ -264,14 +352,36 @@ fun app(val http: HttpSecurity): SecurityFilterChain {
264
352
----
265
353
======
266
354
You can read more https://github.com/spring-projects/spring-security/issues/15220[in the related ticket].
355
+
* `ServerHttpSecurity` now https://github.com/spring-projects/spring-security/issues/15974[picks up `ServerWebExchangeFirewall` as a `@Bean`]
267
356
268
-
== One-Time Token Login
269
-
270
-
Spring Security now xref:servlet/authentication/onetimetoken.adoc[supports One-Time Token Login] via the `oneTimeTokenLogin()` DSL.
357
+
== Observability
271
358
272
-
== Passkeys
359
+
Observability now supports xref:servlet/integrations/observability.adoc#observability-tracing-disable[toggling authorization, authentication, and request observations separately]
360
+
For example, to turn off filter chain observations, you can publish a `@Bean` like this one:
0 commit comments