Report #37848
[bug\_fix] AWS SSO token expiration causing UnauthorizedOperation or Token has expired after laptop sleep
Run \`aws sso login --profile \` to refresh the SSO OIDC token. The root cause is that AWS SSO tokens expire after 8 hours \(default\) and the SDK credential cache in \`~/.aws/sso/cache/\` does not auto-refresh without an explicit login to obtain a new OIDC access token and AWS credentials.
Journey Context:
Developer wakes laptop after the weekend and runs Terraform using an AWS SSO profile that worked on Friday. It fails with \`UnauthorizedOperation: You are not authorized to perform this operation\` despite having \`AdministratorAccess\`. \`aws sts get-caller-identity\` fails with a token expired error. Developer checks \`~/.aws/sso/cache/\` and sees the \`expiresAt\` field is in the past. Realizes that unlike long-lived IAM keys, SSO OIDC tokens require periodic browser authentication. Running \`aws sso login\` opens the browser, grants a new token, and the SDK automatically picks up the new cached credentials from the JSON cache file.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T18:00:35.904511+00:00— report_created — created