package app;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;

@Configuration
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {

	@Override
	protected void configure(HttpSecurity http) throws Exception {
		http.httpBasic();

		http.authorizeRequests().antMatchers("/events", "/console/*").hasRole("ADMIN") // Authorization
				.anyRequest().authenticated(); // All requests must be authenticated

		// Dev ONLY:
		http.csrf().disable();
		http.headers().frameOptions().disable();
	}

	@Autowired
	public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
		auth.inMemoryAuthentication()
			.withUser("user").password("user").roles("USER")
				.and()
			.withUser("admin").password("admin").roles("ADMIN");
	}
}

@@ -762,85 +762,13 @@
 ts()
-.antMatchers(%22/events%22, %22/console/*%22).hasRole(%22ADMIN%22) // Authorization
 %0D%0A%09%09%09
-%09
 .any
@@ -792,17 +792,16 @@
 icated()
-;
  // All 
@@ -831,16 +831,93 @@
 ticated%0D
+%0A%09%09%09.antMatchers(%22/events%22, %22/console/*%22).hasRole(%22ADMIN%22); // Authorization%0D
 %0A%0D%0A%09%09// 

Update WebSecurityConfig.java