CloudConsole

Error loading SSO Token: Token for <profile> does not exist

Updated 16 November 2026 · How we write and check guides

Short answer

The CLI looked in ~/.aws/sso/cache for a sign-in token matching this profile's SSO session or start URL and found none. Run aws sso login with the same profile that failed; if the error persists, the profile points at a different sso-session or start URL from the one you logged in with, or the tool runs as another user or in a container that can't see your cache.

Causes, most likely first, in 5 steps: 1. Never logged in on this machine or user account; 2. Logged in through a different…
The diagnosis and fix steps from this page, in the order to try them; commands and details are below.

What the CLI is looking for

When you run aws sso login, the CLI saves a token file in ~/.aws/sso/cache/. The file name is derived from the sso-session name (or, for legacy profiles, the sso_start_url). Later commands recompute that name from the profile and open the file. If it isn't there you get:

Error loading SSO Token: Token for my-org does not exist

The name after "Token for" is the sso-session name or start URL the CLI used for the lookup, which is a useful clue: compare it with what you logged in to.

Causes, most likely first

CauseExample
Never logged in on this machine or user accountNew laptop, fresh container, or the cache was cleared by aws sso logout
Logged in through a different profile that uses a different sessiondev uses [sso-session dev-org], prod uses [sso-session my-org]
Legacy profiles whose sso_start_url strings differ slightlyOne has https://my-org.awsapps.com/start, another adds #/ or a trailing slash, so each hashes to a different file
Command runs as a different userUsing sudo, a service account, or a CI agent user
Docker container without the SSO cacheOnly ~/.aws/config was copied in, not ~/.aws/sso/cache

Fix it

  1. Log in with exactly the profile that failed:
    aws sso login --profile prod-admin
    aws sts get-caller-identity --profile prod-admin
  2. Check the profile's session if that doesn't stick:
    aws configure get sso_session --profile prod-admin
    grep -A4 '^\[sso-session' ~/.aws/config
    Point related profiles at one shared sso_session so a single login covers them.
  3. Normalise legacy start URLs, or better, run aws configure sso to move profiles to the sso-session format.
  4. Give containers the whole directory (read-only is fine, but a refresh then can't be written back):
    docker run --rm -v "$HOME/.aws:/root/.aws:ro" \
      -e AWS_PROFILE=prod-admin amazon/aws-cli sts get-caller-identity
  5. Check the cache exists for your user:
    ls -la ~/.aws/sso/cache/

Related mistakes

  • Running aws sso login without --profile while AWS_PROFILE is unset logs in the default profile, which may not be an SSO profile at all.
  • Deleting ~/.aws/sso/cache as a fix and then not logging in again. That reliably produces this error.
  • Setting AWS_PROFILE in one terminal tab and running the command in another. Each shell has its own environment, so the second tab falls back to whatever profile it had.
  • If the message instead says the token has expired and refresh failed, the cache file exists but is stale; see that page.

Questions

Where does the AWS CLI store SSO tokens?

In ~/.aws/sso/cache as JSON files named from a hash of the sso-session name or start URL. Role credentials obtained with them are cached separately under ~/.aws/cli/cache.

Why does aws sso login work but other commands say the token does not exist?

You logged in with one profile and are running commands with another that resolves to a different sso-session or start URL. Log in with the failing profile, or make both use the same sso_session.

Do I need to log in separately for each SSO profile?

Not if they share an sso-session block. One aws sso login for that session covers every profile that references it.

CloudConsole access check screen on a phone, for following up on Error loading SSO Token away from your desk
When this happens away from your desk

This is mainly a local setup problem, but it tends to appear on a fresh machine just when you need access quickly. CloudConsole, a phone app for AWS, is built to let you read alarms and logs on your phone in the meantime.

Did it start after a deploy? What changed? on the app’s alarm screen lists the deploys and configuration changes from the hour before the alarm fired.

About the app → · Download on the App Store

Sources