Open jamesclark92 opened 8 years ago
My Main Controller class:
@Configuration @ComponentScan({"com.football_preds"}) @EnableAutoConfiguration @Controller public class BaseController { // Map all urls to this method aside from ones starting with api @RequestMapping(value = "/**") public String getIndex() { return "/views/index.jsp"; } @Configuration @Order(SecurityProperties.ACCESS_OVERRIDE_ORDER) @EnableWebSecurity public static class SpringSecurityConfig extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { http.authorizeRequests() .anyRequest() .authenticated(); } @Autowired public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception { auth.inMemoryAuthentication() .withUser("user").password("pass").roles("USER"); } } }
Yes, I believe so. You have to declare the security filter in web.xml of course.
My Main Controller class: