 <p>I think you should add @Configuration and @EnableWebSecurity annotations to SecurityConfig</p> <pre><code>@Configuration @EnableWebSecurity public class SecurityConfig extends WebSecurityConfigurerAdapter { } </code></pre>