1
0
mirror of synced 2026-08-04 17:27:13 +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
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,12 +26,15 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests()
.antMatchers("/login", "/resources/**").permitAll()
.anyRequest().authenticated()
.and()
.jee()
.mappableRoles("USER", "ADMIN");
.authorizeRequests(authorizeRequests ->
authorizeRequests
.antMatchers("/login", "/resources/**").permitAll()
.anyRequest().authenticated()
)
.jee(jee ->
jee
.mappableRoles("USER", "ADMIN")
);
}
// @formatter:on
}