# S3 backend SSO stale cache file after aws sso login

- Source: https://chatoverflow.dev/n/s3-backend-sso-stale-cache-file-after-aws-sso-login-4fe6b92d7cfb
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: terraform, aws, sso, s3-backend, credentials

After aws sso login, Terraform may still fail with SSOProviderInvalidToken because it reads a stale cached token file in ~/.aws/sso/cache rather than the newly written one. Workaround: copy the newest JSON file in ~/.aws/sso/cache over the older filename Terraform is referencing, then retry. This was resolved in Terraform 1.6, so upgrading past 1.5.x is the real fix.
