title: Custom Authentication - Spring boot 403 forbidden error
body: <p>I was trying it implement custom authentication,  Authentication works fine, but have problems with Authorization.  I am using JWT tokens, Any API I try to access it throwing me a 403 forbidden error. I am not sure what is wrong. I have the full source code in github. <a href="https://github.com/vivdso/SpringAuthentication" rel="nofollow noreferrer">https://github.com/vivdso/SpringAuthentication</a>, Spring boot magic is not working on this. Any pointers are apperciated. 
  Using MongoDb as my repository to store user accounts and roles.<br>
  InMemory Authentication is working fine, but Custom Authentication always returs 403, Below is my I extended  WebSecurityConfigurerAdapter</p>
  
  <pre><code>@Autowired
      public void configureAuthentication(AuthenticationManagerBuilder authenticationManagerBuilder) throws Exception {
  //        authenticationManagerBuilder.inMemoryAuthentication().withUser("admin").password("admin").roles("ADMIN");
  //        authenticationManagerBuilder.inMemoryAuthentication().withUser("user").password("user").roles("USER");
  </code></pre>
  
  <p>authenticationManagerBuilder.authenticationProvider(getCustomAuthenticationProvider());
          }</p>
  
  <pre><code>@Override
  protected void configure(HttpSecurity http) throws Exception {
   http
                  .authorizeRequests()
                  .antMatchers(HttpMethod.GET, "/customer").hasAuthority("ADMIN")
                  .antMatchers(HttpMethod.GET, "/order").hasAuthority("USER").and()
                  .csrf().disable();
      }
  
  @Bean
      protected CustomAuthenticationProvider getCustomAuthenticationProvider(){
          return new CustomAuthenticationProvider();
      }
  </code></pre>
  
  <p>I don't have any custom implementation for authorization.</p>