[Solved] An error occurred (UnauthorizedException) when calling ListAccounts operation: Session token not found or invalid

If you are using aws configure sso to populate your ~/.aws/credentials file and you get the following error when you try and reauthorize, then you can solve this problem as follows:

An error occurred (UnauthorizedException) when calling ListAccounts operation: Session token not found or invalid

Step 1 – Logout from SSO

aws sso logout
Code language: Bash (bash)

Step 2 – Reconfigure SSO with previous defaults

aws configure sso
Code language: Bash (bash)

Tags:
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments