Skip to content

Commit

Permalink
CLI-1133: FedAuth API calls require org scope (#418)
Browse files Browse the repository at this point in the history
* CLI-1133: FedAuth API calls require org scope

* fix

* fix
  • Loading branch information
danepowell authored Aug 28, 2023
1 parent f23bf36 commit 9f0bcb9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Empty file added build/.gitkeep
Empty file.
6 changes: 5 additions & 1 deletion src/Connector/Connector.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,11 @@ public function createRequest(string $verb, string $path): RequestInterface
/** @infection-ignore-all */
$cache = new FilesystemAdapter('cache', 300, $directory);
$accessToken = $cache->get('cloudapi-token', function () {
return $this->provider->getAccessToken('client_credentials');
$options = [];
if ($orgUuid = getenv('AH_ORGANIZATION_UUID')) {
$options['scope'] = 'organization:' . $orgUuid;
}
return $this->provider->getAccessToken('client_credentials', $options);
});

$this->accessToken = $accessToken;
Expand Down

0 comments on commit 9f0bcb9

Please sign in to comment.