[BUG] Authentication using IAM Identity Center credentials is failing

Status Open
Reported on v2.1.248
Maintainer reply None cached
Activity 0 comments · opened Aug 28, 2026

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?

I am using Claude Code via Bedrock. In Claude Code 2.1.248 and 2.1.250, an error "O is not defined" occurs on the Claude Code side during authentication with AWS. There is no issue with Claude Code 2.1.247.

% mairu exec --server=[REDACTED] [REDACTED] env CLAUDE_CODE_USE_BEDROCK=1 [REDACTED] claude -p hello
:: mairu :: Login to [REDACTED] ([REDACTED]) ::::::::
:: mairu ::
:: mairu ::
:: mairu :: Open the following URL to continue
:: mairu :: >   [REDACTED]
:: mairu ::
:: mairu ::
@smithy/node-http-handler - [WARN] a request has exceeded the configured 1000 ms requestTimeout. Init client requestHandler with throwOnRequestTimeout=true to turn this into an error.
API Error: O is not defined

Here, I use https://github.com/sorah/mairu for authentication with AWS. In short, this tool uses IAM Identity Center credentials to handle authentication via AWS_CONTAINER_CREDENTIALS_FULL_URI and AWS_CONTAINER_AUTHORIZATION_TOKEN.

In addition, the following points have been verified:

  • Calling the same Anthropic model using aws bedrock-runtime invoke-model succeeds with the same credentials (mairu exec --server=[REDACTED] [REDACTED] aws bedrock-runtime invoke-model ...).
  • Claude Code returns a response without any errors when using static credentials with mairu exec --mode=static --server=[REDACTED] [REDACTED].

Because of this, I suspect there might be a bug in a specific path where Claude Code processes AWS credentials.

What Should Happen?

Return a response without authentication errors.

Error Messages/Logs

With claude --debug -p hello, it showed auth errors in the debug logs:

2026-08-28T01:12:50.265Z [DEBUG] ESC[2m2026-08-28T01:12:50.264552ZESC[0m ESC[32m INFOESC[0m ESC[2mmairu::cmd::loginESC[0mESC[2m:ESC[0m Logged in
2026-08-28T01:12:50.277Z [DEBUG] AWS auth refresh completed successfully
2026-08-28T01:12:50.277Z [DEBUG] Clearing AWS credential provider cache
2026-08-28T01:12:50.279Z [DEBUG] Failed to refresh AWS credential cache: Could not resolve credentials using profile: [default] in configuration/credentials file(s).
2026-08-28T01:12:50.279Z [DEBUG] [API:auth] AWS credential resolve done in 8567ms
2026-08-28T01:12:50.281Z [DEBUG] [API:auth] resolving default AWS provider chain (region: us-east-1)
2026-08-28T01:12:54.458Z [ERROR] Bedrock ListInferenceProfiles failed: O is not defined
2026-08-28T01:12:54.458Z [ERROR] Failed to list Bedrock inference profiles, falling back to hardcoded models: O is not defined
2026-08-28T01:13:31.472Z [DEBUG] [API:timing] dispatching to bedrock model=arn:aws:bedrock:[REDACTED]
2026-08-28T01:13:31.475Z [DEBUG] [API:auth] resolving default AWS provider chain (region: us-east-1)
2026-08-28T01:13:34.494Z [ERROR] API error (attempt 6/11): undefined Failed to resolve AWS credentials from the credential provider chain.
2026-08-28T01:13:41.740Z [DEBUG] Preserving file permissions: 100600
2026-08-28T01:13:41.740Z [DEBUG] Writing to temp file: /Users/nekketsuuu/.claude.json.tmp.99905.b4684547700a
2026-08-28T01:13:41.742Z [DEBUG] Applied original permissions to temp file
2026-08-28T01:13:41.742Z [DEBUG] Temp file written successfully, size: 200904 bytes
2026-08-28T01:13:41.742Z [DEBUG] Renaming /Users/nekketsuuu/.claude.json.tmp.99905.b4684547700a to /Users/nekketsuuu/.claude.json
2026-08-28T01:13:41.742Z [DEBUG] File /Users/nekketsuuu/.claude.json written atomically
2026-08-28T01:13:52.093Z [DEBUG] [API:timing] dispatching to bedrock model=arn:aws:bedrock:[REDACTED]
2026-08-28T01:13:52.096Z [DEBUG] [API:auth] resolving default AWS provider chain (region: us-east-1)
2026-08-28T01:13:55.113Z [ERROR] API error (attempt 7/11): undefined Failed to resolve AWS credentials from the credential provider chain.
2026-08-28T01:14:01.774Z [DEBUG] [skills] idle — switching poll interval to 30000ms
2026-08-28T01:14:32.644Z [DEBUG] [API:timing] dispatching to bedrock model=arn:aws:bedrock:[REDACTED]
2026-08-28T01:14:32.646Z [DEBUG] [API:auth] resolving default AWS provider chain (region: us-east-1)
2026-08-28T01:14:35.666Z [ERROR] API error (attempt 8/11): undefined Failed to resolve AWS credentials from the credential provider chain.
2026-08-28T01:15:11.975Z [DEBUG] [API:timing] dispatching to bedrock model=arn:aws:bedrock:[REDACTED]
2026-08-28T01:15:11.978Z [DEBUG] [API:auth] resolving default AWS provider chain (region: us-east-1)
2026-08-28T01:15:14.999Z [ERROR] API error (attempt 9/11): undefined Failed to resolve AWS credentials from the credential provider chain.
2026-08-28T01:15:53.265Z [DEBUG] [API:timing] dispatching to bedrock model=arn:aws:bedrock:[REDACTED]
2026-08-28T01:15:53.267Z [DEBUG] [API:auth] resolving default AWS provider chain (region: us-east-1)
2026-08-28T01:15:56.296Z [ERROR] API error (attempt 10/11): undefined Failed to resolve AWS credentials from the credential provider chain.
2026-08-28T01:16:29.892Z [DEBUG] [API:timing] dispatching to bedrock model=arn:aws:bedrock:[REDACTED]
2026-08-28T01:16:29.895Z [DEBUG] [API:auth] resolving default AWS provider chain (region: us-east-1)
2026-08-28T01:16:32.914Z [ERROR] API error (attempt 11/11): undefined Failed to resolve AWS credentials from the credential provider chain.
2026-08-28T01:16:32.933Z [ERROR] Error in API request: Failed to resolve AWS credentials from the credential provider chain.
2026-08-28T01:16:32.934Z [ERROR] API connection_error after retries: Failed to resolve AWS credentials from the credential provider chain.

Steps to Reproduce

  1. Configure Mairu and Claude Code
  2. Launch Claude Code by mairu exec ... claude -p 'hello'
  3. It throws the error.

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.247

Claude Code Version

2.1.250 (Claude Code)

Platform

AWS Bedrock

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗