@@ -0,0 +1,2064 @@
+package com.aws.securingweb;%0A%0Aimport org.springframework.context.annotation.Bean;%0Aimport org.springframework.context.annotation.Configuration;%0Aimport org.springframework.security.config.annotation.web.builders.HttpSecurity;%0Aimport org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;%0Aimport org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;%0Aimport org.springframework.security.core.userdetails.User;%0Aimport org.springframework.security.core.userdetails.UserDetails;%0Aimport org.springframework.security.core.userdetails.UserDetailsService;%0Aimport org.springframework.security.provisioning.InMemoryUserDetailsManager;%0Aimport org.springframework.security.web.util.matcher.AntPathRequestMatcher;%0A%0A@Configuration%0A@EnableWebSecurity%0Apublic class WebSecurityConfig extends WebSecurityConfigurerAdapter %7B%0A     @Override%0A    protected void configure(HttpSecurity http) throws Exception %7B%0A        http%0A                .authorizeRequests()%0A                .antMatchers(%0A                        %22/js/**%22,%0A                        %22/css/**%22,%0A                        %22/img/**%22,%0A                        %22/webjars/**%22).permitAll()%0A                .anyRequest().authenticated()%0A                .and()%0A                .formLogin()%0A                .loginPage(%22/login%22)%0A                .permitAll()%0A                .and()%0A                .logout()%0A                .invalidateHttpSession(true)%0A                .clearAuthentication(true)%0A                .logoutRequestMatcher(new AntPathRequestMatcher(%22/logout%22))%0A                .logoutSuccessUrl(%22/login?logout%22)%0A                .permitAll();%0A%0A        http.csrf().disable();%0A    %7D%0A%0A    @Bean%0A    @Override%0A    public UserDetailsService userDetailsService() %7B%0A        UserDetails user =%0A                User.withDefaultPasswordEncoder()%0A                        .username(%22user%22)%0A                        .password(%22password%22)%0A                        .roles(%22USER%22)%0A                        .build();%0A%0A        return new InMemoryUserDetailsManager(user);%0A    %7D%0A%7D%0A

Create WebSecurityConfig.java