title: Not able to access REST controllers in Spring Securtiy even when the role matches
body: <p>WebSecurityConfig class is as follows:-</p>
  
  <pre><code>@Configuration
  @EnableWebSecurity
  public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
  
  
  
      @Override
      public void configure(HttpSecurity http) throws Exception {
  
          http.authorizeRequests()
                  .antMatchers("/get*").hasAnyRole();
  
  
      }
  
      @Override
      protected void configure(AuthenticationManagerBuilder auth) throws Exception {
          auth.inMemoryAuthentication()
                  .withUser("user1").password("user1Pass")
                  .authorities("USER");
                  //.and().withUser("admin").password("adminPass")
                  //.authorities("ADMIN");
      }
  
  
      /*@Autowired
      public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
          auth.inMemoryAuthentication().passwordEncoder(NoOpPasswordEncoder.getInstance())
                  .withUser("test").password("test123").roles("USER").and().
                  withUser("test1").password("test123").roles("ADMIN");
      }
  
  }*/
      }
  </code></pre>
  
  <p>Below is the REST controller:-</p>
  
  <pre><code>@RequestMapping(value="/getprofessors", method=RequestMethod.GET)
      public List&lt;Professor&gt; getProfessors() {
  
          //return service.findProfessors();
  
          List&lt;Professor&gt; Professors = professorRepo.findAll();
  
          return  Professors;
  
      }
  </code></pre>
  
  <p>Below image represents the POSTMAN call I'm making:-</p>
  
  <p><a href="https://i.stack.imgur.com/M24ic.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/M24ic.png" alt="Postman call I&#39;m trying to make"></a></p>
  
  <p>Getting 403 error when accessing this controller even when no role specification has been provided.</p>