Urgent.News

What's breaking now, across thousands of outlets.

Finance & Markets

Fed up with repeated `aws sso login`? Fix your config!

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…

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.

The 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.

To 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.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Finance & Markets

Millennium explores Geneva tax deal

Millennium Management is negotiating with authorities in Geneva over a potential tax arrangement that could pave the way for an expansion of its presence in the French-speaking Swiss canton, according…

  • Millennium Management seeks tax deal in Geneva to expand operations.
  • Proposal aims to attract high-net-worth individuals and firms to tax-favorable Zurich.
  • Geneva's higher tax rates of up to 45% motivate the potential agreement.

More from Tuesday 8 September →