title: BitBucket Rest API OAuth2: How to use Client Credentials Grant
body: <p>I am trying to use bullet 4 ( Client Credentials Grant ) in order to obtain an access/bearer token <a href="https://developer.atlassian.com/bitbucket/api/2/reference/meta/authentication" rel="nofollow noreferrer">authentication documentation</a></p>
  
  <p>Example:</p>
  
  <pre><code>  curl -X POST -u "client_id:secret" \
    https://bitbucket.org/site/oauth2/access_token \
    -d grant_type=client_credentials
  </code></pre>
  
  <p>I have created an OAuth Consumer. I take the "Secret" that is generated from this Consumer and simply plug it in the example above for "secret", and I receive an "unauthorized client" result, when I expect to get back an access token.</p>
  
  <p>Result:</p>
  
  <pre><code>{"error_description": "Invalid OAuth client credentials", "error": "unauthorized_client"}%
  </code></pre>
  
  <p>I have also ensured the consumer I have created as all permissions available. </p>
  
  <p>Am I plugging the wrong value into the secret section? Or what else could I be doing incorrectly? </p>