title: faced 'Spring Security & whitelabel Error 404' at the very first step
body: <p>I just started making
  Springboot starter project with gradle</p>
  <p>first of all, i can't understand why i see security log-in page even when i set config permitAll
  and secondly, i see 404 error after i log-in correctly</p>
  <p><strong>this is my SecurityConfig</strong></p>
  <pre><code>package config;
  
  import org.springframework.context.annotation.Configuration;
  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 SecurityConfig extends WebSecurityConfigurerAdapter {
  
      @Override
      protected void configure(HttpSecurity http) throws Exception {
          // TODO Auto-generated method stub
          //super.configure(http);
          
          http.authorizeRequests()
              .anyRequest().permitAll();  
      }
  
  }
  </code></pre>
  <p><strong>this is the controller</strong></p>
  <pre><code>package notice;
  
  import org.springframework.web.bind.annotation.GetMapping;
  import org.springframework.web.bind.annotation.RestController;
  
  @RestController
  public class ApiNoticeController {
      
      @GetMapping(&quot;/api/notice&quot;)
      public String noticeSting() {
          return &quot;notice&quot;;
      }
  }
  </code></pre>
  <p><strong>dependencies</strong></p>
  <pre><code>dependencies {
      implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
      implementation 'org.springframework.boot:spring-boot-starter-security'
      implementation 'org.springframework.boot:spring-boot-starter-web'
      compileOnly 'org.projectlombok:lombok'
      runtimeOnly 'com.h2database:h2'
      annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
      annotationProcessor 'org.projectlombok:lombok'
      testImplementation 'org.springframework.boot:spring-boot-starter-test'
      testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
      testImplementation 'org.springframework.security:spring-security-test'
  }
  </code></pre>
  <p><strong>console</strong>
  2022-03-23 18:50:34.733  INFO 27256 --- [           main] com.example.demo.PracticeApplication     : Starting PracticeApplication using Java 17.0.1 on DESKTOP-JBB51IM with PID 27256 (C:\Users\user1\Desktop\CRUD\practice\bin\main started by user1 in C:\Users\user1\Desktop\CRUD\practice)
  2022-03-23 18:50:34.740  INFO 27256 --- [           main] com.example.demo.PracticeApplication     : No active profile set, falling back to 1 default profile: &quot;default&quot;
  2022-03-23 18:50:36.429  INFO 27256 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
  2022-03-23 18:50:36.453  INFO 27256 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 8 ms. Found 0 JPA repository interfaces.
  2022-03-23 18:50:37.521  INFO 27256 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
  2022-03-23 18:50:37.538  INFO 27256 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
  2022-03-23 18:50:37.538  INFO 27256 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.58]
  2022-03-23 18:50:37.773  INFO 27256 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
  2022-03-23 18:50:37.774  INFO 27256 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 2922 ms
  2022-03-23 18:50:38.067  INFO 27256 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
  2022-03-23 18:50:38.415  INFO 27256 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Start completed.
  2022-03-23 18:50:38.508  INFO 27256 --- [           main] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [name: default]
  2022-03-23 18:50:38.614  INFO 27256 --- [           main] org.hibernate.Version                    : HHH000412: Hibernate ORM core version 5.6.5.Final
  2022-03-23 18:50:39.009  INFO 27256 --- [           main] o.hibernate.annotations.common.Version   : HCANN000001: Hibernate Commons Annotations {5.1.2.Final}
  2022-03-23 18:50:39.252  INFO 27256 --- [           main] org.hibernate.dialect.Dialect            : HHH000400: Using dialect: org.hibernate.dialect.H2Dialect
  2022-03-23 18:50:39.781  INFO 27256 --- [           main] o.h.e.t.j.p.i.JtaPlatformInitiator       : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
  2022-03-23 18:50:39.801  INFO 27256 --- [           main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
  2022-03-23 18:50:39.866  WARN 27256 --- [           main] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
  2022-03-23 18:50:40.609  INFO 27256 --- [           main] .s.s.UserDetailsServiceAutoConfiguration :</p>
  <p>Using generated security password: ****</p>
  <p>2022-03-23 18:50:40.934  INFO 27256 --- [           main] o.s.s.web.DefaultSecurityFilterChain     : Will not secure any request
  2022-03-23 18:50:41.124  INFO 27256 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
  2022-03-23 18:50:41.145  INFO 27256 --- [           main] com.example.demo.PracticeApplication     : Started PracticeApplication in 7.185 seconds (JVM running for 9.471)
  2022-03-23 18:50:48.680  INFO 27256 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
  2022-03-23 18:50:48.680  INFO 27256 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
  2022-03-23 18:50:48.681  INFO 27256 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 1 ms
  2022-03-23 18:50:49.157  WARN 27256 --- [nio-8080-exec-1] o.a.c.util.SessionIdGeneratorBase        : Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [397] milliseconds.</p>
  <p>it worked well at first, returning URL &quot;http://localhost:8080/api/notice&quot; &amp; String &quot;notice&quot;
  but suddenly not working...</p>
  <p>What I know and saw is that I used @RestController so i don't need html view resolver...</p>
  <p>i also tried with configuration -
  // super.configure(http);
  super.configure(http);</p>
  <p>both...didn't work</p>