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
`AclEntryVoter`, `AclEntryAfterInvocationProvider`, and `AclPermissionEvaluator` provide the same service, plugged into different Spring Security APIs. Now that `AccessDecisionVoter` and `AfterInvocationProvider` are both deprecated, the corresponding ACL plugins are obsolete.
6
+
7
+
As such, begin using `AclPermissionEvaluator` before updating to Spring Security 7.
== Opaque Token Credentials Will Be Encoded For You
4
-
5
-
In order to comply more closely with the Introspection RFC, Spring Security's opaque token support will encode the client id and secret before creating the authorization header.
6
-
This change means you will no longer have to encode the client id and secret yourself.
7
-
8
-
If your client id or secret contain URL-unsafe characters, then you can prepare yourself for this change by doing the following:
9
-
10
-
=== Replace Usage of `introspectionClientCredentials`
11
-
12
-
Since Spring Security can now do the encoding for you, replace xref:servlet/oauth2/resource-server/opaque-token.adoc#oauth2resourceserver-opaque-introspectionuri-dsl[using `introspectionClientCredentials`] with publishing the following `@Bean`:
Copy file name to clipboardExpand all lines: docs/modules/ROOT/pages/migration-7/authorization.adoc
+79
Original file line number
Diff line number
Diff line change
@@ -22,3 +22,82 @@ public void doSomething(Long id) {
22
22
23
23
You must compile with `-parameters` to ensure that the parameter names are available at runtime.
24
24
For more information about this, please visit the https://github.com/spring-projects/spring-framework/wiki/Upgrading-to-Spring-Framework-6.x#core-container[Upgrading to Spring Framework 6.1 page].
25
+
26
+
=== Favor `AnnotationTemplateExpressionDefaults` over `PrePostTemplateDefaults`
27
+
28
+
In Spring Security 7, `AnnotationTemplateExpressionDefaults` will be included by default.
29
+
30
+
If you are customizing `PrePostTemplateDefaults` or simply want to see how your application responds to `AnnotationTemplateExpressionDefaults`, you can publish an `AnnotationTemplateExpressionDefaults` bean instead of a `PrePostTemplateDefaults` method:
If you are publishing an `AuthorizationAdvisor` bean, like `AuthorizationManagerBeforeMethodInterceptor`, `AuthorizationManagerAfterMethodInterceptor`, `PreFilterAuthorizationMethodInterceptor`, or `PostFilterAuthorizationMethodInterceptor`, you can do the same by calling `setTemplateDefaults` with an `AnnotationTemplateExpressionDefaults` instance instead:
65
+
66
+
[tabs]
67
+
======
68
+
Java::
69
+
+
70
+
[source,java,role="primary"]
71
+
----
72
+
@Bean
73
+
@Role(BeanDescription.ROLE_INFRASTRUCTURE)
74
+
static Advisor preFilter() {
75
+
PreFilterAuthorizationMethodInterceptor interceptor = new PreFilterAuthorizationMethodInterceptor();
=== Publish `AuthorizationAdvisor` instances instead of adding them in a `Customizer<AuthorizationAdvisorProxyFactory>`
98
+
99
+
While the ability to customize the `AuthorizationAdvisorProxyFactory` instance will remain in Spring Security 7, the ability to add advisors will be removed in favor of picking up published `AuthorizationAdvisor` beans.
100
+
101
+
If you are not calling `AuthorizationAdvisorProxyFactory#setAdvisors` or `AuthorizationAdvisorProxyFactory#addAdvisor`, you need do nothing.
102
+
103
+
If you are, publish the `AuthorizationAdvisor` bean instead and Spring Security will pick it up and apply it automatically.
Copy file name to clipboardExpand all lines: docs/modules/ROOT/pages/migration-7/configuration.adoc
+57
Original file line number
Diff line number
Diff line change
@@ -123,3 +123,60 @@ In versions prior to 6.2, if you had a xref:servlet/configuration/java.adoc#jc-c
123
123
However, starting from version 6.2, this method is deprecated and will be removed in 7.0 because it will no longer be possible to chain configurations using `.and()` once `.and()` is removed (see https://github.com/spring-projects/spring-security/issues/13067).
124
124
Instead, it is recommended to use the new `.with(...)` method.
125
125
For more information about how to use `.with(...)` please refer to the xref:servlet/configuration/java.adoc#jc-custom-dsls[Custom DSLs section].
126
+
127
+
== Use `dispatcherTypeMatchers` instead of `shouldFilterAllDispatcherTypes`
128
+
129
+
If you are permitting the ERROR dispatch, you may be using `shouldFilterAllDispatcherTypes(false)` in the `auhorizeHttpRequests` DSL:
130
+
131
+
[tabs]
132
+
======
133
+
Java::
134
+
+
135
+
[source,java,role="primary"]
136
+
----
137
+
http
138
+
.authorizeHttpRequests((authorize) -> authorize
139
+
.shouldFilterAllDispatcherTypes(false)
140
+
// ...
141
+
)
142
+
----
143
+
144
+
Kotlin::
145
+
+
146
+
[source,kotlin,role="secondary"]
147
+
----
148
+
http {
149
+
authorizeHttpRequests {
150
+
shouldFilterAllDispatcherTypes = false
151
+
// ...
152
+
}
153
+
}
154
+
----
155
+
======
156
+
157
+
In preparation for 7, change this to use `dispatcherTypeMatchers`:
Copy file name to clipboardExpand all lines: docs/modules/ROOT/pages/migration-7/oauth2.adoc
+67
Original file line number
Diff line number
Diff line change
@@ -170,3 +170,70 @@ fun jwtDecoder(): JwtDecoder {
170
170
<2> - specify the list of validators you need, excluding `JwtTypeValidator`
171
171
172
172
For additional guidance, please see the xref:servlet/oauth2/resource-server/jwt.adoc#oauth2resourceserver-jwt-validation[JwtDecoder Validators] section in the reference.
173
+
174
+
== Opaque Token Credentials Will Be Encoded For You
175
+
176
+
In order to comply more closely with the Introspection RFC, Spring Security's opaque token support will encode the client id and secret before creating the authorization header.
177
+
This change means you will no longer have to encode the client id and secret yourself.
178
+
179
+
If your client id or secret contain URL-unsafe characters, then you can prepare yourself for this change by doing the following:
180
+
181
+
=== Replace Usage of `introspectionClientCredentials`
182
+
183
+
Since Spring Security can now do the encoding for you, replace xref:servlet/oauth2/resource-server/opaque-token.adoc#oauth2resourceserver-opaque-introspectionuri-dsl[using `introspectionClientCredentials`] with publishing the following `@Bean`:
0 commit comments