1
0
mirror of synced 2026-08-05 01:36:56 +00:00

Use http security nested builder in samples

Issue: gh-5557
This commit is contained in:
Eleftheria Stein
2019-07-12 14:00:07 -04:00
parent b004f9f677
commit a0ca45e4b8
14 changed files with 224 additions and 144 deletions
@@ -38,13 +38,17 @@ public class OAuth2ResourceServerSecurityConfiguration extends WebSecurityConfig
protected void configure(HttpSecurity http) throws Exception {
// @formatter:off
http
.authorizeRequests()
.antMatchers("/message/**").hasAuthority("SCOPE_message:read")
.anyRequest().authenticated()
.and()
.oauth2ResourceServer()
.jwt()
.decoder(jwtDecoder());
.authorizeRequests(authorizeRequests ->
authorizeRequests
.antMatchers("/message/**").hasAuthority("SCOPE_message:read")
.anyRequest().authenticated()
)
.oauth2ResourceServer(oauth2ResourceServer ->
oauth2ResourceServer
.jwt(jwt ->
jwt.decoder(jwtDecoder())
)
);
// @formatter:on
}