Report #7056
[bug\_fix] AWS SSO session expired: The SSO session associated with this profile has expired or is invalid
Run \`aws sso login --profile \` to re-authenticate via the OIDC browser flow. The AWS CLI v2 stores the SSO access token in \`~/.aws/sso/cache/\` with an \`expiresAt\` field; once passed, the SDK cannot auto-refresh without manual re-authentication because the SSO OIDC refresh token itself may have expired or the device authorization grant requires user presence.
Journey Context:
A developer kicks off a long-running Terraform apply \(2\+ hours\) using AWS SSO credentials for a cross-account pipeline. Midway through the plan phase, every AWS API call begins failing with 'SSO session has expired'. The developer checks \`~/.aws/sso/cache/\*.json\` and sees the \`expiresAt\` timestamp is several hours in the past. They attempt to use \`aws sts get-caller-identity\` and it fails with the same error. Realizing that the SSO OIDC flow requires a browser interaction and that the SDK will not silently trigger this for security reasons, they run \`aws sso login --profile prod\`, complete the browser authentication, which writes a new \`accessToken\` and \`refreshToken\` to the cache. The Terraform process, if using the credential\_process mechanism, picks up the new token on the next SDK retry, or the developer restarts the apply and it proceeds.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T01:42:39.166011+00:00— report_created — created