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 {
    
	/**
	 * To logout, use /logout
	 */
	@Override
    protected void configure(HttpSecurity http) throws Exception {
        http
        	.csrf().disable()
            .authorizeRequests()
                .antMatchers("/events", "/console").hasRole("ADMIN") // Authorization: .antMatchers("/events").permitAll()
                .anyRequest().authenticated() // All requests must be authenticated
                .and()
            .httpBasic();
    }

    @Autowired
    public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
        auth
            .inMemoryAuthentication()
                .withUser("user").password("user").roles("USER")
                	.and()
                .withUser("admin").password("admin").roles("ADMIN");
    }
}
@@ -634,52 +634,8 @@
  %7B%0D%0A
-    %0D%0A%09/**%0D%0A%09 * To logout, use /logout%0D%0A%09 */
 %0D%0A%09@
@@ -644,20 +644,17 @@
 erride%0D%0A
-    
+%09
 protecte
@@ -713,62 +713,37 @@
  %7B%0D%0A
-        http%0D%0A        %09.csrf().disable
+%09%09http.httpBasic
 ()
+;
 %0D%0A
-            
+%0D%0A%09%09http
 .aut
@@ -758,34 +758,16 @@
 quests()
-%0D%0A                
 .antMatc
@@ -791,16 +791,18 @@
 /console
+/*
 %22).hasRo
@@ -833,63 +833,14 @@
 tion
-: .antMatchers(%22/events%22).permitAll()%0D%0A                
+%0D%0A%09%09%09%09
 .any
@@ -864,16 +864,17 @@
 icated()
+;
  // All 
@@ -893,88 +893,135 @@
 t be
- authenticated%0D%0A                .and
+%0D%0A%09%09%09%09%09%09%09%09%09%09%09%09// Authenticated%0D%0A%0D%0A%09%09// Dev ONLY:%0D%0A%09%09http.csrf().disable
 ()
+;
 %0D%0A
-            .httpBasic
+%09%09http.headers().frameOptions().disable
 ();%0D%0A
-    
+%09
 %7D%0D%0A%0D%0A
-    
+%09
 @Aut
@@ -1028,20 +1028,17 @@
 owired%0D%0A
-    
+%09
 public v
@@ -1116,34 +1116,14 @@
  %7B%0D%0A
-        auth%0D%0A            
+%09%09auth
 .inM
@@ -1145,32 +1145,19 @@
 tion()%0D%0A
-                
+%09%09%09
 .withUse
@@ -1202,49 +1202,23 @@
 %22)%0D%0A
-                %09.and()%0D%0A                
+%09%09%09%09.and()%0D%0A%09%09%09
 .wit
@@ -1271,12 +1271,11 @@
 );%0D%0A
-    
+%09
 %7D%0D%0A%7D
+%0D%0A

Update WebSecurityConfig.java