title: POSTing in OAuth with client credentials with Doorkeeper
body: <p>I've implemented a REST API and protected it with doorkeeper.
  I've written a small client program to access it and it works fine using the resource owner credential flow.</p>
  
  <p>Now I'm trying to implement a call using the client credentials <a href="https://github.com/applicake/doorkeeper/wiki/Client-Credentials-flow">flow</a>. So I've followed the example in the link.</p>
  
  <p>Everything works great when I'm using a GET request, but when I'm using a POST request, I'm getting a <code>401 Unauthorized</code>. This is a call to a method that doesn't require a resource owner.</p>
  
  <p>The only relevant thing I have in my API controller is:</p>
  
  <pre><code>doorkeeper_for :all
  </code></pre>
  
  <p>I haven't implemented any scopes or nothing of that kind (am I required to?).</p>
  
  <p>My client code looks like this (exactly as in the <a href="https://github.com/applicake/doorkeeper/wiki/Client-Credentials-flow">example in github</a>):</p>
  
  <pre><code>require 'rest-client'
  require 'json'
  
  client_id = 'my_client_id...'
  client_secret = 'my_client_secret...'
  
  response = RestClient.post 'http://localhost:3000/oauth/token', {
    grant_type: 'client_credentials',
    client_id: client_id,
    client_secret: client_secret
  }
  token = JSON.parse(response)["access_token"]
  
  # this line works great:
  RestClient.get 'http://localhost:3000/api/v1/flights.json', { 'Authorization' =&gt; "Bearer #{token}" }
  # this line always fails (401 Unauthorized):
  RestClient.post 'http://localhost:3000/api/v1/flights.json', { 'Authorization' =&gt; "Bearer #{token}" }
  </code></pre>
  
  <p>Any idea what I may be doing wrong? Is there something special I should do in my application in order to enable the client credentials flow?</p>