File tree 4 files changed +12
-12
lines changed
docs/modules/ROOT/pages/servlet
4 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -67,9 +67,9 @@ SecurityFilterChain web(HttpSecurity http) throws Exception {
67
67
http
68
68
// ...
69
69
.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>
73
73
.anyRequest().denyAll() // <5>
74
74
);
75
75
@@ -142,7 +142,7 @@ Here is an example of mapping a custom authorization manager to the `my/authoriz
142
142
SecurityFilterChain web(HttpSecurity http) throws Exception {
143
143
http
144
144
.authorizeHttpRequests((authorize) -> authorize
145
- .mvcMatchers ("/my/authorized/endpoint").access(new CustomAuthorizationManager());
145
+ .requestMatchers ("/my/authorized/endpoint").access(new CustomAuthorizationManager());
146
146
)
147
147
// ...
148
148
Original file line number Diff line number Diff line change @@ -189,7 +189,7 @@ public class MyCustomSecurityConfiguration {
189
189
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
190
190
http
191
191
.authorizeHttpRequests(authorize -> authorize
192
- .mvcMatchers ("/messages/**").hasAuthority("SCOPE_message:read")
192
+ .requestMatchers ("/messages/**").hasAuthority("SCOPE_message:read")
193
193
.anyRequest().authenticated()
194
194
)
195
195
.oauth2ResourceServer(oauth2 -> oauth2
@@ -744,8 +744,8 @@ public class DirectlyConfiguredJwkSetUri {
744
744
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
745
745
http
746
746
.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")
749
749
.anyRequest().authenticated()
750
750
)
751
751
.oauth2ResourceServer(OAuth2ResourceServerConfigurer::jwt);
Original file line number Diff line number Diff line change @@ -232,7 +232,7 @@ public class MyCustomSecurityConfiguration {
232
232
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
233
233
http
234
234
.authorizeHttpRequests(authorize -> authorize
235
- .mvcMatchers ("/messages/**").hasAuthority("SCOPE_message:read")
235
+ .requestMatchers ("/messages/**").hasAuthority("SCOPE_message:read")
236
236
.anyRequest().authenticated()
237
237
)
238
238
.oauth2ResourceServer(oauth2 -> oauth2
@@ -520,8 +520,8 @@ public class MappedAuthorities {
520
520
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
521
521
http
522
522
.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")
525
525
.anyRequest().authenticated()
526
526
)
527
527
.oauth2ResourceServer(OAuth2ResourceServerConfigurer::opaqueToken);
Original file line number Diff line number Diff line change @@ -340,7 +340,7 @@ public class MyCustomSecurityConfiguration {
340
340
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
341
341
http
342
342
.authorizeHttpRequests(authorize -> authorize
343
- .mvcMatchers ("/messages/**").hasAuthority("ROLE_USER")
343
+ .requestMatchers ("/messages/**").hasAuthority("ROLE_USER")
344
344
.anyRequest().authenticated()
345
345
)
346
346
.saml2Login(withDefaults());
@@ -496,7 +496,7 @@ public class MyCustomSecurityConfiguration {
496
496
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
497
497
http
498
498
.authorizeHttpRequests(authorize -> authorize
499
- .mvcMatchers ("/messages/**").hasAuthority("ROLE_USER")
499
+ .requestMatchers ("/messages/**").hasAuthority("ROLE_USER")
500
500
.anyRequest().authenticated()
501
501
)
502
502
.saml2Login(saml2 -> saml2
You can’t perform that action at this time.
0 commit comments