[BUG] Fails to authenticate using AWS SSO profile
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
According to the documentation, one supported way to configure Claude Code to use an AWS SSO profile for connecting to Amazon Bedrock is:
$ aws sso login --profile <your-profile-name>
$ export AWS_PROFILE=<your-profile-name>
However, this approach does not work. Claude Code fails to authenticate when using an SSO profile configured this way. The only workaround my colleague found is to add the following line to the corresponding profile definition in ~/.aws/config (where default is the profile name):
credential_process = aws configure export-credentials --profile default
Without this additional configuration, authentication via AWS SSO does not succeed.
What Should Happen?
Claude Code should automatically retrieve and use the credentials from the configured AWS SSO token, without requiring any additional manual configuration.
Error Messages/Logs
API Error: Value not present for 'accessToken' in SSO Token. To refresh this SSO session run 'aws sso login' with the corresponding profile.
Steps to Reproduce
- Run Claude Code
- Perform any query
- After a few minutes, the error mentioned above is displayed
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.0.69 (Claude Code)
Platform
AWS Bedrock
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
_No response_
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗