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
Add RequestMatcher MigrationPath for SwitchUserFilter
To simplify migration, the filter's setter methods still use AntPathRequestMatcher.
Users can call the equivalent RequestMatcher setter methods to opt-in to the change early.
Issue gh-16417
Copy file name to clipboardExpand all lines: docs/modules/ROOT/pages/migration/web.adoc
+43-7Lines changed: 43 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,21 +42,57 @@ This will tell the Spring Security DSL to use `PathPatternRequestMatcher` for al
42
42
43
43
In the event that you are directly constructing an object (as opposed to having the DSL construct it) that has a `setRequestMatcher` method. you should also proactively specify a `PathPatternRequestMatcher` there as well.
44
44
45
-
For example, in the case of `LogoutFilter`, it constructs an `AntPathRequestMatcher` in Spring Security 6:
45
+
=== Migrate `exitUserUrl` and `switchUserUrl` Request Matchers in `SwitchUserFilter`
46
46
47
-
[method,java]
47
+
`SwitchUserFilter`, constructs an `AntPathRequestMatcher` in its `setExitUserUrl` and `setSwitchUserUrl` methods.
48
+
This will change to use `PathPatternRequestMatcher` in Spring Security 7.
49
+
50
+
To prepare for this change, call `setExitUserMatcher` and `setSwithcUserMatcher` to provide this `PathPatternRequestMatcher` in advance.
51
+
That is, change this:
52
+
53
+
[tabs]
54
+
======
55
+
Java::
56
+
+
57
+
[source,java,role="primary"]
48
58
----
49
-
private RequestMatcher logoutUrl = new AntPathRequestMatcher("/logout");
59
+
SwitchUserFilter switchUser = new SwitchUserFilter();
60
+
// ... other configuration
61
+
switchUser.setExitUserUrl("/exit/impersonate");
50
62
----
51
63
52
-
and will change this to a `PathPatternRequestMatcher` in 7:
0 commit comments