title: POST request "Full authentication is required to access this resource"
body: <p>Does anybody encountered the error "Full authentication is required to access this resource" trying to authenticate by using POST request oauth/token?</p>
  
  <p><strong>Curl command:</strong></p>
  
  <pre><code>curl localhost:85/oauth/token -d grant_type=password -d client_id=web_app -d username=reader -d password=reader
  </code></pre>
  
  <p><strong>Response:</strong></p>
  
  <pre><code>{"timestamp":1486841819620,"status":401,"error":"Unauthorized","message":"Full authentication is required to access this resource","path":"/oauth/token"}
  </code></pre>
  
  <p><strong>ResourceServerConfiguration configure</strong></p>
  
  <pre><code>http .csrf().disable() .authorizeRequests() .antMatchers("/**").authenticated() .antMatchers(HttpMethod.GET, "/me").hasAuthority("FOO_READ")
  </code></pre>
  
  <p><strong>WebSecurityConfig configure</strong></p>
  
  <pre><code>http .csrf().disable() .exceptionHandling() .authenticationEntryPoint((request, response, authException) -&gt; response.sendError(HttpServletResponse.SC_UNAUTHORIZED))
  </code></pre>
  
  <p>Thanks!</p>