{
  "id": 6255026,
  "title": "Fed up with repeated `aws sso login`? Fix your config!",
  "url": "https://urgent.news/2026/09/08/fed-up-with-repeated-aws-sso-login-fix-your-config",
  "topic": "finance",
  "section": "Finance & Markets",
  "published": "2026-09-08T08:09:38.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/aws-builders/fed-up-with-repeated-aws-sso-login-fix-your-config-1kp2"
  },
  "original_language": "en",
  "account": "If you frequently experience the error message \"aws: [ERROR]: Error when retrieving token from sso: Token has expired and refresh failed\" while managing multiple AWS accounts through IAM Identity Center, it may be due to outdated configuration settings. The issue stems from legacy configuration files that do not support refresh tokens, leading to frequent login prompts. To resolve this, you should update your AWS configuration to use a shared SSO session block, which enables refresh token functionality across all profiles.\n\nThe two tokens involved in the AWS SSO process have different lifetimes: the access token, which typically lasts 8 hours and is managed automatically by the CLI, and the refresh token, which can persist for up to 90 days when configured correctly. The access token expiration is normal and handled by the CLI, while the refresh token is responsible for obtaining a new access token when the old one expires.\n\nTo implement the fix, you'll need to modify your AWS configuration file by adding the [sso-session] section, which centralizes the SSO settings and allows all profiles to share the same refreshable session. This approach eliminates the need to repeat SSO settings for each profile, reducing the likelihood of encountering login errors. Additionally, you should adjust the session duration settings in the AWS Identity Center to ensure the refresh token remains valid for an extended period, typically up to 90 days. This change will help consolidate logins and prevent frequent login prompts.",
  "summary": "If you juggle a lot of AWS accounts through IAM Identity Center, you know the ritual. You sit down, run a command, and get slapped with this: aws: [ERROR]: Error when retrieving token from sso: Token has expired and refresh failed So you type aws sso login again. And again tomorrow. And again after lunch. Here's the thing I figured out the hard way: if, just like me, your config file was…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}