Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## NOT RELEASED

## 1.24.1

### Fixed

- Better detection and error messages for when SSO is used but required packages are not installed.

## 1.24.0

### Added
Expand Down
7 changes: 4 additions & 3 deletions src/Core/src/Credentials/IniFileProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use AsyncAws\Core\Exception\RuntimeException;
use AsyncAws\Core\Sts\StsClient;
use AsyncAws\Sso\SsoClient;
use AsyncAws\SsoOidc\SsoOidcClient;
use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;
use Symfony\Contracts\HttpClient\HttpClientInterface;
Expand Down Expand Up @@ -94,8 +95,8 @@ private function getCredentialsFromProfile(array $profilesData, string $profile,
}

if (isset($profileData[IniFileLoader::KEY_SSO_SESSION])) {
if (!class_exists(SsoClient::class)) {
$this->logger->warning('The profile "{profile}" contains SSO session config but the "async-aws/sso" package is not installed. Try running "composer require async-aws/sso".', ['profile' => $profile]);
if (!class_exists(SsoClient::class) || !class_exists(SsoOidcClient::class)) {
$this->logger->warning('The profile "{profile}" contains SSO session config but the required packages ("async-aws/sso" and "async-aws/sso-oidc") are not installed. Try running "composer require async-aws/sso async-aws/sso-oidc".', ['profile' => $profile]);

return null;
}
Expand All @@ -104,7 +105,7 @@ private function getCredentialsFromProfile(array $profilesData, string $profile,
}

if (isset($profileData[IniFileLoader::KEY_SSO_START_URL])) {
if (class_exists(SsoClient::class)) {
if (!class_exists(SsoClient::class)) {
$this->logger->warning('The profile "{profile}" contains SSO (legacy) config but the "async-aws/sso" package is not installed. Try running "composer require async-aws/sso".', ['profile' => $profile]);

return null;
Expand Down
Loading