Skip to content

Commit 38a7bbd

Browse files
Merge branch '5.8.x'
2 parents 76d7a85 + ace8caa commit 38a7bbd

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

Diff for: docs/modules/ROOT/pages/servlet/authorization/authorize-http-requests.adoc

+4-4
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ SecurityFilterChain web(HttpSecurity http) throws Exception {
6767
http
6868
// ...
6969
.authorizeHttpRequests(authorize -> authorize // <1>
70-
.mvcMatchers("/resources/**", "/signup", "/about").permitAll() // <2>
71-
.mvcMatchers("/admin/**").hasRole("ADMIN") // <3>
72-
.mvcMatchers("/db/**").access(new WebExpressionAuthorizationManager("hasRole('ADMIN') and hasRole('DBA')")) // <4>
70+
.requestMatchers("/resources/**", "/signup", "/about").permitAll() // <2>
71+
.requestMatchers("/admin/**").hasRole("ADMIN") // <3>
72+
.requestMatchers("/db/**").access(new WebExpressionAuthorizationManager("hasRole('ADMIN') and hasRole('DBA')")) // <4>
7373
.anyRequest().denyAll() // <5>
7474
);
7575
@@ -142,7 +142,7 @@ Here is an example of mapping a custom authorization manager to the `my/authoriz
142142
SecurityFilterChain web(HttpSecurity http) throws Exception {
143143
http
144144
.authorizeHttpRequests((authorize) -> authorize
145-
.mvcMatchers("/my/authorized/endpoint").access(new CustomAuthorizationManager());
145+
.requestMatchers("/my/authorized/endpoint").access(new CustomAuthorizationManager());
146146
)
147147
// ...
148148

Diff for: docs/modules/ROOT/pages/servlet/oauth2/resource-server/jwt.adoc

+3-3
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ public class MyCustomSecurityConfiguration {
189189
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
190190
http
191191
.authorizeHttpRequests(authorize -> authorize
192-
.mvcMatchers("/messages/**").hasAuthority("SCOPE_message:read")
192+
.requestMatchers("/messages/**").hasAuthority("SCOPE_message:read")
193193
.anyRequest().authenticated()
194194
)
195195
.oauth2ResourceServer(oauth2 -> oauth2
@@ -744,8 +744,8 @@ public class DirectlyConfiguredJwkSetUri {
744744
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
745745
http
746746
.authorizeHttpRequests(authorize -> authorize
747-
.mvcMatchers("/contacts/**").hasAuthority("SCOPE_contacts")
748-
.mvcMatchers("/messages/**").hasAuthority("SCOPE_messages")
747+
.requestMatchers("/contacts/**").hasAuthority("SCOPE_contacts")
748+
.requestMatchers("/messages/**").hasAuthority("SCOPE_messages")
749749
.anyRequest().authenticated()
750750
)
751751
.oauth2ResourceServer(OAuth2ResourceServerConfigurer::jwt);

Diff for: docs/modules/ROOT/pages/servlet/oauth2/resource-server/opaque-token.adoc

+3-3
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ public class MyCustomSecurityConfiguration {
232232
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
233233
http
234234
.authorizeHttpRequests(authorize -> authorize
235-
.mvcMatchers("/messages/**").hasAuthority("SCOPE_message:read")
235+
.requestMatchers("/messages/**").hasAuthority("SCOPE_message:read")
236236
.anyRequest().authenticated()
237237
)
238238
.oauth2ResourceServer(oauth2 -> oauth2
@@ -520,8 +520,8 @@ public class MappedAuthorities {
520520
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
521521
http
522522
.authorizeHttpRequests(authorizeRequests -> authorizeRequests
523-
.mvcMatchers("/contacts/**").hasAuthority("SCOPE_contacts")
524-
.mvcMatchers("/messages/**").hasAuthority("SCOPE_messages")
523+
.requestMatchers("/contacts/**").hasAuthority("SCOPE_contacts")
524+
.requestMatchers("/messages/**").hasAuthority("SCOPE_messages")
525525
.anyRequest().authenticated()
526526
)
527527
.oauth2ResourceServer(OAuth2ResourceServerConfigurer::opaqueToken);

Diff for: docs/modules/ROOT/pages/servlet/saml2/login/overview.adoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ public class MyCustomSecurityConfiguration {
340340
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
341341
http
342342
.authorizeHttpRequests(authorize -> authorize
343-
.mvcMatchers("/messages/**").hasAuthority("ROLE_USER")
343+
.requestMatchers("/messages/**").hasAuthority("ROLE_USER")
344344
.anyRequest().authenticated()
345345
)
346346
.saml2Login(withDefaults());
@@ -496,7 +496,7 @@ public class MyCustomSecurityConfiguration {
496496
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
497497
http
498498
.authorizeHttpRequests(authorize -> authorize
499-
.mvcMatchers("/messages/**").hasAuthority("ROLE_USER")
499+
.requestMatchers("/messages/**").hasAuthority("ROLE_USER")
500500
.anyRequest().authenticated()
501501
)
502502
.saml2Login(saml2 -> saml2

0 commit comments

Comments
 (0)