Report #92397
[bug\_fix] AWS SSO token has expired and refresh failed: Token retrieval failed from sso
Run \`aws sso login --profile \` to trigger a fresh browser-based authentication flow. The cached token in ~/.aws/sso/cache/ cannot be refreshed automatically after the 8-hour session expires; AWS SSO requires interactive re-authentication.
Journey Context:
Developer runs a Terraform apply that worked yesterday, now it fails with 'Token has expired and refresh failed'. They check ~/.aws/credentials but it's empty because SSO doesn't store long-term keys there. They check the SSO cache files and see timestamps from 12 hours ago. They try \`aws sts get-caller-identity --profile my-sso-profile\` and get the same expiry error. Checking the AWS SSO documentation, they realize the session duration is configured to 8 hours in the AWS SSO console and the refresh token flow is not supported for programmatic CLI access without re-authentication. After running \`aws sso login\`, completing the browser MFA prompt, and re-running Terraform, the flow succeeds.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T13:40:50.342774+00:00— report_created — created