July 2018
Intermediate to advanced
268 pages
7h 36m
English
Modify the SpringSecurityConfiguration.java file, as follows:
@EnableWebSecurity@Configuration@EnableGlobalMethodSecurity(securedEnabled = true)public class SpringSecurityConfig extends WebSecurityConfigurerAdapter { private static final Logger LOG = LoggerFactory.getLogger(SpringSecurityConfig.class); @Override protected void configure(HttpSecurity http) throws Exception { http.authorizeRequests() .antMatchers("/admins").hasRole("ADMINS") .antMatchers("/users").hasRole("USERS") .anyRequest().fullyAuthenticated() .and() .httpBasic(); // Use Basic authentication } @Override public void configure(AuthenticationManagerBuilder auth) throws Exception { auth .ldapAuthentication() .userDnPatterns("uid={0},ou=people") ...Read now
Unlock full access