Report #56325
[bug\_fix] AWS SSO token expired: 'The security token included in the request is expired' when using AWS SSO profiles
Execute \`aws sso login --profile \` to refresh the SSO token. The root cause is that AWS SSO tokens \(stored in \`~/.aws/sso/cache/\`\) expire after 8-12 hours and must be manually refreshed; the SDK cannot auto-refresh SSO tokens without this CLI step.
Journey Context:
Developer runs a Python script locally using \`boto3\` with an AWS SSO profile. It works perfectly on Monday. On Tuesday morning, every API call fails with 'ExpiredToken'. They check \`~/.aws/credentials\` but it's empty \(as expected with SSO\). They verify IAM permissions in the console—everything looks correct. They try \`aws sts get-caller-identity\` and get the same error. After searching the error code, they realize the SSO session token stored in the cache has a TTL that expired overnight. Running \`aws sso login\` generates a new access token and refresh token, allowing the SDK to obtain fresh temporary credentials.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T01:02:10.698568+00:00— report_created — created