Use requestMatchers

Closes gh-96
This commit is contained in:
Marcus Da Coregio
2022-10-07 15:35:14 -03:00
parent 92e7c69e19
commit 456419bff0
13 changed files with 24 additions and 24 deletions

View File

@@ -43,8 +43,8 @@ public class OAuth2ResourceServerSecurityConfiguration {
// @formatter:off
http
.authorizeHttpRequests((authorize) -> authorize
.antMatchers(HttpMethod.GET, "/message/**").hasAuthority("SCOPE_message:read")
.antMatchers(HttpMethod.POST, "/message/**").hasAuthority("SCOPE_message:write")
.requestMatchers(HttpMethod.GET, "/message/**").hasAuthority("SCOPE_message:read")
.requestMatchers(HttpMethod.POST, "/message/**").hasAuthority("SCOPE_message:write")
.anyRequest().authenticated()
)
.oauth2ResourceServer(OAuth2ResourceServerConfigurer::jwt);