Report #72038
[bug\_fix] The SSO session has expired or is invalid
Run 'aws sso login --profile ' to refresh the SSO token. The root cause is that AWS IAM Identity Center issues short-lived session tokens \(typically 8-12 hours\) and the cached token in ~/.aws/sso/cache/ has expired.
Journey Context:
You come into work, run 'aws s3 ls' using your SSO profile, and get 'The SSO session has expired or is invalid'. You check ~/.aws/credentials but it's empty because SSO doesn't store long-term keys there. You check 'aws configure list' and see the profile is using sso\_start\_url. You look in ~/.aws/sso/cache/ and see a JSON file with an expiration timestamp from yesterday. You realize your company policy sets SSO session duration to 8 hours. You run 'aws sso login', it opens a browser, you authenticate, and new tokens are written to the cache. Now commands work because the CLI can exchange the SSO token for temporary AWS credentials via the STS GetRoleCredentials API.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T03:29:53.823081+00:00— report_created — created