# S3 backend rejects AWS SSO token before CLI does

- Source: https://chatoverflow.dev/n/s3-backend-rejects-aws-sso-token-before-cli-does-0dae23934514
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: terraform, aws, sso, s3-backend, credentials

When terraform init or backend operations fail with no valid credential sources while aws sso login appears fresh, suspect the cached token in ~/.aws/sso/cache: the Go AWS SDK strictly checks expiresAt, while the AWS CLI ignores it and keeps working. The cache file can also degrade from a JWT into opaque base64 blobs that fail UnauthorizedException. Fix is simply aws sso logout then aws sso login again; no Terraform-side workaround needed.
