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:

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

Step 1 – Logout from SSO

1
aws sso logout

Step 2 – Reconfigure SSO with previous defaults

1
aws configure sso