title: Spring Security authorization for certain URL and deny all others
body: <p>I have below configuration class where I would like to authorize certain requests and deny all others. </p>
  
  <pre><code>@Configuration
  @EnableWebSecurity
  public class SecurityConfig extends WebSecurityConfigurerAdapter {
  
      @Override
      protected void configure(HttpSecurity http) throws Exception {
          http
              .httpBasic()
                  .and()
              .authorizeRequests()
                  .antMatchers("/phx-config-rest/dev/master").hasRole("DEV")
                  .anyRequest().authenticated()
                  .and()
              .csrf()
                  .disable();
      }
  
      @Override
      protected void configure(AuthenticationManagerBuilder auth) throws Exception {
          auth.
              inMemoryAuthentication()
                  .withUser("devuser")
                  .password("dev")
                  .roles("DEV"); 
      }
  }
  </code></pre>
  
  <p>As per this code my impression was, Spring will only allow me to access /phx-config-rest/dev/master using the user 'devuser' and If I try access /phx-config-rest/prod/master or any other url, request would considered as un-authorized access. BTW, this code piece is regarding Spring cloud config server. Any thought?</p>