Report #77592
[bug\_fix] Unable to locate credentials: AWS SSO profile not found in credential chain
Set the AWS\_PROFILE environment variable to the name of the SSO-configured profile \(e.g., 'export AWS\_PROFILE=my-sso-profile'\) so the SDK credential chain loads the SSO token. If using boto3/botocore, ensure the version supports SSO credential resolution from the token cache \(botocore >= 1.17.0\).
Journey Context:
A developer authenticates using AWS SSO by running 'aws sso login --profile my-sso-profile'. The login succeeds and they can run CLI commands with '--profile my-sso-profile'. However, when they run a Python script using boto3 without specifying a profile, it fails with 'Unable to locate credentials'. The developer checks ~/.aws/credentials and sees it's empty \(expected for SSO\). They check ~/.aws/config and see the \[profile my-sso-profile\] with sso\_start\_url. The issue is that the SDK does not know to use the my-sso-profile unless AWS\_PROFILE is set, or the code explicitly creates a Session with profile\_name='my-sso-profile'. Additionally, if using an old boto3 version, SSO support isn't in the default credential chain. Setting the env var fixes it.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T12:50:37.140734+00:00— report_created — created