title: How to configure a private Bitbucket repository so I could include a private package in composer.json?
body: <p>I have a private <code>Git</code> repository in <code>Bitbucket.org</code>. It consists of a <code>Laravel</code> project that is ready to be used as a <code>composer</code> <code>package</code>. I don't want to publish it, I just want to be able to use it my other <code>Laravel</code> project by including it in <code>composer.json</code>. I googled a lot for tutorials and questions/answers on stackoverflow but I still am not able to do that. Here is a part of my <code>composer.json</code> file that should be relevant:</p>
  
  <pre><code>"require": {
      "php": "&gt;=5.6.4",
      "myprovider/mypackage": "*",
      "laravel/framework": "5.4.*",
      "laravel/tinker": "~1.0"
  },
  "repositories": {
      "myrepository": {
          "type": "vcs",
          "url": "https://bitbucket.org/me/myrepository/"
      }
  },
  </code></pre>
  
  <p>I tried <code>composer require myprovider/mypackage:*</code>, but then I get an error <code>Could not fetch https://api.bitbucket.org/2.0/repositories/me/myrepository?fields=-project%2C-owner, please create a bitbucket OAuth token to access private repos</code>. Since I actually created OAuth token before, I pasted the required <code>Consumer Key</code> and <code>Consumer Secret</code> but then I get this:</p>
  
  <pre><code>Invalid OAuth consumer provided.
  This can have two reasons:
  1. You are authenticating with a bitbucket username/password combination
  2. You are using an OAuth consumer, but didn't configure a (dummy) callback url
  
  Installation failed, reverting ./composer.json to its original content.
  
    [Composer\Downloader\TransportException]
    The "?pagelen=100&amp;fields=values.name%2Cvalues.target.hash%2Cnext&amp;sort=-target.date" 
  file could not be downloaded: failed to open stream: Resource temporarily unavailable
  </code></pre>
  
  <p>I am new to <code>Bitbucket</code>, how should I know if I configured everything properly?</p>
  
  <p>A step by step configuration would be awesome, none of the ones I found online fit for my situation.</p>