diff --git a/src/Composer/Util/AuthHelper.php b/src/Composer/Util/AuthHelper.php index da36e426b..2341fc517 100644 --- a/src/Composer/Util/AuthHelper.php +++ b/src/Composer/Util/AuthHelper.php @@ -125,8 +125,9 @@ class AuthHelper ) { throw new TransportException('Could not authenticate against '.$origin, 401); } - } elseif ($origin === 'bitbucket.org') { + } elseif ($origin === 'bitbucket.org' || $origin === 'api.bitbucket.org') { $askForOAuthToken = true; + $origin = 'bitbucket.org'; if ($this->io->hasAuthentication($origin)) { $auth = $this->io->getAuthentication($origin); if ($auth['username'] !== 'x-token-auth') { diff --git a/src/Composer/Util/Bitbucket.php b/src/Composer/Util/Bitbucket.php index d75310cf7..f91c2757e 100644 --- a/src/Composer/Util/Bitbucket.php +++ b/src/Composer/Util/Bitbucket.php @@ -142,7 +142,7 @@ class Bitbucket $this->io->writeError($message); } - $url = 'https://confluence.atlassian.com/bitbucket/oauth-on-bitbucket-cloud-238027431.html'; + $url = 'https://support.atlassian.com/bitbucket-cloud/docs/use-oauth-on-bitbucket-cloud/'; $this->io->writeError(sprintf('Follow the instructions on %s', $url)); $this->io->writeError(sprintf('to create a consumer. It will be stored in "%s" for future use by Composer.', $this->config->getAuthConfigSource()->getName())); $this->io->writeError('Ensure you enter a "Callback URL" (http://example.com is fine) or it will not be possible to create an Access Token (this callback url will not be used by composer)');