function Bitbucket::authorizeOAuth
Attempts to authorize a Bitbucket domain via OAuth
Parameters
string $originUrl The host this Bitbucket instance is located at:
Return value
bool true on success
File
-
vendor/
composer/ composer/ src/ Composer/ Util/ Bitbucket.php, line 73
Class
- Bitbucket
- @author Paul Wenke <wenke.paul@gmail.com>
Namespace
Composer\UtilCode
public function authorizeOAuth(string $originUrl) : bool {
if ($originUrl !== 'bitbucket.org') {
return false;
}
// if available use token from git config
if (0 === $this->process
->execute([
'git',
'config',
'bitbucket.accesstoken',
], $output)) {
$this->io
->setAuthentication($originUrl, 'x-token-auth', trim($output));
return true;
}
return false;
}