Created
December 7, 2020 02:52
-
-
Save pedroveras/6c7e8e4313ca90b324701c51f24594c8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Configuration | |
@EnableWebSecurity | |
public class SecurityConfig extends WebSecurityConfigurerAdapter { | |
@Override | |
protected void configure(HttpSecurity http) throws Exception { | |
http.authorizeRequests(authorizeRequests -> | |
authorizeRequests | |
.antMatchers(HttpMethod.GET, "/hello").hasAuthority("SCOPE_hello") | |
.anyRequest().authenticated() | |
).oauth2ResourceServer(OAuth2ResourceServerConfigurer::jwt); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment