claude-code - 💡(How to fix) Fix 3P Bedrock SSO: credentials silently expire without triggering re-auth on day 2+

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

In 3P (Cowork) deployments using Bedrock SSO (inferenceCredentialKind: "interactive", inferenceBedrockSso* fields), credentials expire after ~8 hours and the app never attempts to re-authenticate. Users open the app the next day and it silently fails to make inference calls — no sign-in prompt, no error dialog, just dead sessions.

Error Message

In 3P (Cowork) deployments using Bedrock SSO (inferenceCredentialKind: "interactive", inferenceBedrockSso* fields), credentials expire after ~8 hours and the app never attempts to re-authenticate. Users open the app the next day and it silently fails to make inference calls — no sign-in prompt, no error dialog, just dead sessions. fE.BedrockSso is absent from this condition. When the stored Bedrock SSO token is expired (isBedrockSsoTokenUsable returns false) and resolve({interactive: false}) returns the zI sentinel, the function falls through to the error/empty-return path instead of opening the device-code window. The app has the infrastructure (withDeviceCodeWindow, doGrant via Lhi, credentialResolveStatusMessage already handling BedrockSso) — the re-auth just isn't wired into the trigger condition.

Root Cause

Root Cause (source-verified)

Fix Action

Fix / Workaround

  • Deployment type: 3P / Cowork, Bedrock SSO (inferenceCredentialKind: "interactive")
  • Trigger: Any session started after the access token + refresh window expires (day 2 for most users with default IAM Identity Center settings)
  • Symptom: App loads, no sign-in prompt, inference calls silently fail or hang
  • Workaround: None practical at scale. Clearing custom3pBedrockSsoTokens from config.json forces re-auth on next launch but requires per-user intervention. Credential helper scripts require AWS CLI on every user machine, which is not viable for end-user Cowork deployments.

Code Example

t === "interactive" && o === zI &&
(r.interactiveKind === fE.GatewaySso || r.interactiveKind === fE.FoundryEntra)

---

t === "interactive" && o === zI &&
(r.interactiveKind === fE.GatewaySso ||
 r.interactiveKind === fE.FoundryEntra ||
 r.interactiveKind === fE.BedrockSso)   // ← missing

---

return e.accessTokenExpiresAt - 120_000 > Date.now()
    || (!!e.refreshToken && e.clientExpiresAt > Date.now())
RAW_BUFFERClick to expand / collapse

Summary

In 3P (Cowork) deployments using Bedrock SSO (inferenceCredentialKind: "interactive", inferenceBedrockSso* fields), credentials expire after ~8 hours and the app never attempts to re-authenticate. Users open the app the next day and it silently fails to make inference calls — no sign-in prompt, no error dialog, just dead sessions.

Root Cause (source-verified)

In resolveCredentialOverrides, the inline device-code re-auth gate only fires for GatewaySso and FoundryEntra:

t === "interactive" && o === zI &&
(r.interactiveKind === fE.GatewaySso || r.interactiveKind === fE.FoundryEntra)

fE.BedrockSso is absent from this condition. When the stored Bedrock SSO token is expired (isBedrockSsoTokenUsable returns false) and resolve({interactive: false}) returns the zI sentinel, the function falls through to the error/empty-return path instead of opening the device-code window. The app has the infrastructure (withDeviceCodeWindow, doGrant via Lhi, credentialResolveStatusMessage already handling BedrockSso) — the re-auth just isn't wired into the trigger condition.

The fix is one line — add fE.BedrockSso to the condition:

t === "interactive" && o === zI &&
(r.interactiveKind === fE.GatewaySso ||
 r.interactiveKind === fE.FoundryEntra ||
 r.interactiveKind === fE.BedrockSso)   // ← missing

Token lifetime context

isBedrockSsoTokenUsable (wZe):

return e.accessTokenExpiresAt - 120_000 > Date.now()
    || (!!e.refreshToken && e.clientExpiresAt > Date.now())

AWS IAM Identity Center access tokens typically expire in 8 hours. The refresh token path covers the window, but once both are expired the re-auth gate must fire — and currently doesn't for Bedrock.

Impact

  • Deployment type: 3P / Cowork, Bedrock SSO (inferenceCredentialKind: "interactive")
  • Trigger: Any session started after the access token + refresh window expires (day 2 for most users with default IAM Identity Center settings)
  • Symptom: App loads, no sign-in prompt, inference calls silently fail or hang
  • Workaround: None practical at scale. Clearing custom3pBedrockSsoTokens from config.json forces re-auth on next launch but requires per-user intervention. Credential helper scripts require AWS CLI on every user machine, which is not viable for end-user Cowork deployments.

Environment

  • Claude desktop app (3P/Cowork deployment mode)
  • deploymentMode: "3p" in claude_desktop_config.json
  • inferenceProvider: "bedrock", inferenceCredentialKind: "interactive"
  • AWS IAM Identity Center SSO via inferenceBedrockSsoStartUrl

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING