|
@@ -231,7 +231,7 @@ public class MyCustomSecurityConfiguration {
|
|
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
|
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
|
http
|
|
http
|
|
.authorizeHttpRequests(authorize -> authorize
|
|
.authorizeHttpRequests(authorize -> authorize
|
|
- .mvcMatchers("/messages/**").hasAuthority("SCOPE_message:read")
|
|
|
|
|
|
+ .requestMatchers("/messages/**").hasAuthority("SCOPE_message:read")
|
|
.anyRequest().authenticated()
|
|
.anyRequest().authenticated()
|
|
)
|
|
)
|
|
.oauth2ResourceServer(oauth2 -> oauth2
|
|
.oauth2ResourceServer(oauth2 -> oauth2
|
|
@@ -513,8 +513,8 @@ public class MappedAuthorities {
|
|
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
|
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
|
http
|
|
http
|
|
.authorizeHttpRequests(authorizeRequests -> authorizeRequests
|
|
.authorizeHttpRequests(authorizeRequests -> authorizeRequests
|
|
- .mvcMatchers("/contacts/**").hasAuthority("SCOPE_contacts")
|
|
|
|
- .mvcMatchers("/messages/**").hasAuthority("SCOPE_messages")
|
|
|
|
|
|
+ .requestMatchers("/contacts/**").hasAuthority("SCOPE_contacts")
|
|
|
|
+ .requestMatchers("/messages/**").hasAuthority("SCOPE_messages")
|
|
.anyRequest().authenticated()
|
|
.anyRequest().authenticated()
|
|
)
|
|
)
|
|
.oauth2ResourceServer(OAuth2ResourceServerConfigurer::opaqueToken);
|
|
.oauth2ResourceServer(OAuth2ResourceServerConfigurer::opaqueToken);
|