Skip to main content

Adding BitBucket OAuth consumer to composer

Create a OAuth consumer token in BitBucket

  1. Go to the workspace settings > OAuth Consumers > Add Consumers.
  2. Enter the Name, Callback URL and check This is a private consumer.
  3. Check the required permissions and click Save.
  4. Copy the consumer key and consumer secret.

Update the auth.json file

  1. Edit auth.json file

    vim /root/.config/composer/auth.json
  2. Remove the bitbucket credentials and add the following lines to the file

    {
    ...
    "bitbucket-oauth": {
    "bitbucket.org": {
    "consumer-key": "<consumer key>",
    "consumer-secret": "<cmsumer secret>"
    }
    },
    ...
    }
  3. Clear composer cache

     composer clear-cache