Skip to content

fix(auth): migrate OAuth token refresh to platform.claude.com with fallback#3246

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-dd753a5f
Mar 26, 2026
Merged

fix(auth): migrate OAuth token refresh to platform.claude.com with fallback#3246
teknium1 merged 1 commit into
mainfrom
hermes/hermes-dd753a5f

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

Anthropic migrated their OAuth infrastructure from console.anthropic.com to platform.claude.com (Claude Code v2.1.81+). This updates _refresh_oauth_token() to try the new endpoint first, falling back to the old one for tokens issued before the migration.

Changes:

  • Primary endpoint: platform.claude.com/v1/oauth/token (tried first)
  • Fallback endpoint: console.anthropic.com/v1/oauth/token (tried if primary fails)
  • Content-Type: switched from application/x-www-form-urlencoded to application/json to match current Claude Code behavior

Salvaged from #2741 by @kshitijk4poor — the original PR was stale against current main (the PKCE flow it also modified was removed in 910ec7e), so only the surviving _refresh_oauth_token() fix was cherry-picked.

Test plan

  • pytest tests/test_anthropic_adapter.py tests/test_anthropic_oauth_flow.py — 79 passed
  • Full suite: 6203 passed (1 pre-existing failure unrelated)

…llback

Anthropic migrated their OAuth infrastructure from console.anthropic.com
to platform.claude.com (Claude Code v2.1.81+). Update _refresh_oauth_token()
to try the new endpoint first, falling back to the old one for tokens
issued before the migration.

Also switches Content-Type from application/x-www-form-urlencoded to
application/json to match current Claude Code behavior.

Salvaged from PR #2741 by kshitijk4poor.
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Supply Chain Risk Detected

This PR contains patterns commonly associated with supply chain attacks. This does not mean the PR is malicious — but these patterns require careful human review before merging.

⚠️ WARNING: Outbound network calls (POST/PUT)

Outbound POST/PUT requests in new code could be data exfiltration. Verify the destination URLs are legitimate.

Matches (first 10):

72:+            with urllib.request.urlopen(req, timeout=10) as resp:

Automated scan triggered by supply-chain-audit. If this is a false positive, a maintainer can approve after manual review.

@teknium1 teknium1 merged commit 2c719f0 into main Mar 26, 2026
1 of 2 checks passed
teknium1 added a commit that referenced this pull request Apr 19, 2026
Anthropic migrated their developer console from console.anthropic.com
to platform.claude.com. Two user-facing display URLs were still pointing
to the old domain:

- hermes_cli/main.py — API key prompt in the Anthropic model flow
- run_agent.py — 401 troubleshooting output

The OAuth token refresh endpoint was already migrated in PR #3246
(with fallback).

Spotted by @LucidPaths in PR #3237.

(Salvage of #3758 — dropped the setup.py hunk since that section was
refactored away and no longer contains the stale URL.)
teknium1 added a commit that referenced this pull request Apr 19, 2026
Anthropic migrated their developer console from console.anthropic.com
to platform.claude.com. Two user-facing display URLs were still pointing
to the old domain:

- hermes_cli/main.py — API key prompt in the Anthropic model flow
- run_agent.py — 401 troubleshooting output

The OAuth token refresh endpoint was already migrated in PR #3246
(with fallback).

Spotted by @LucidPaths in PR #3237.

(Salvage of #3758 — dropped the setup.py hunk since that section was
refactored away and no longer contains the stale URL.)
angelburgosrosado pushed a commit to angelburgosrosado/hermes-agent that referenced this pull request Apr 27, 2026
…llback (NousResearch#3246)

Anthropic migrated their OAuth infrastructure from console.anthropic.com
to platform.claude.com (Claude Code v2.1.81+). Update _refresh_oauth_token()
to try the new endpoint first, falling back to the old one for tokens
issued before the migration.

Also switches Content-Type from application/x-www-form-urlencoded to
application/json to match current Claude Code behavior.

Salvaged from PR NousResearch#2741 by kshitijk4poor.
ulasbilgen pushed a commit to ulasbilgen/hermes-adhd-agent that referenced this pull request May 1, 2026
Anthropic migrated their developer console from console.anthropic.com
to platform.claude.com. Two user-facing display URLs were still pointing
to the old domain:

- hermes_cli/main.py — API key prompt in the Anthropic model flow
- run_agent.py — 401 troubleshooting output

The OAuth token refresh endpoint was already migrated in PR NousResearch#3246
(with fallback).

Spotted by @LucidPaths in PR NousResearch#3237.

(Salvage of NousResearch#3758 — dropped the setup.py hunk since that section was
refactored away and no longer contains the stale URL.)
aj-nt pushed a commit to aj-nt/hermes-agent that referenced this pull request May 1, 2026
Anthropic migrated their developer console from console.anthropic.com
to platform.claude.com. Two user-facing display URLs were still pointing
to the old domain:

- hermes_cli/main.py — API key prompt in the Anthropic model flow
- run_agent.py — 401 troubleshooting output

The OAuth token refresh endpoint was already migrated in PR NousResearch#3246
(with fallback).

Spotted by @LucidPaths in PR NousResearch#3237.

(Salvage of NousResearch#3758 — dropped the setup.py hunk since that section was
refactored away and no longer contains the stale URL.)
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
…llback (NousResearch#3246)

Anthropic migrated their OAuth infrastructure from console.anthropic.com
to platform.claude.com (Claude Code v2.1.81+). Update _refresh_oauth_token()
to try the new endpoint first, falling back to the old one for tokens
issued before the migration.

Also switches Content-Type from application/x-www-form-urlencoded to
application/json to match current Claude Code behavior.

Salvaged from PR NousResearch#2741 by kshitijk4poor.
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
Anthropic migrated their developer console from console.anthropic.com
to platform.claude.com. Two user-facing display URLs were still pointing
to the old domain:

- hermes_cli/main.py — API key prompt in the Anthropic model flow
- run_agent.py — 401 troubleshooting output

The OAuth token refresh endpoint was already migrated in PR NousResearch#3246
(with fallback).

Spotted by @LucidPaths in PR NousResearch#3237.

(Salvage of NousResearch#3758 — dropped the setup.py hunk since that section was
refactored away and no longer contains the stale URL.)
olympus-terminal pushed a commit to olympus-terminal/hermes-agent that referenced this pull request May 16, 2026
…llback (NousResearch#3246)

Anthropic migrated their OAuth infrastructure from console.anthropic.com
to platform.claude.com (Claude Code v2.1.81+). Update _refresh_oauth_token()
to try the new endpoint first, falling back to the old one for tokens
issued before the migration.

Also switches Content-Type from application/x-www-form-urlencoded to
application/json to match current Claude Code behavior.

Salvaged from PR NousResearch#2741 by kshitijk4poor.
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
…llback (NousResearch#3246)

Anthropic migrated their OAuth infrastructure from console.anthropic.com
to platform.claude.com (Claude Code v2.1.81+). Update _refresh_oauth_token()
to try the new endpoint first, falling back to the old one for tokens
issued before the migration.

Also switches Content-Type from application/x-www-form-urlencoded to
application/json to match current Claude Code behavior.

Salvaged from PR NousResearch#2741 by kshitijk4poor.
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
Anthropic migrated their developer console from console.anthropic.com
to platform.claude.com. Two user-facing display URLs were still pointing
to the old domain:

- hermes_cli/main.py — API key prompt in the Anthropic model flow
- run_agent.py — 401 troubleshooting output

The OAuth token refresh endpoint was already migrated in PR NousResearch#3246
(with fallback).

Spotted by @LucidPaths in PR NousResearch#3237.

(Salvage of NousResearch#3758 — dropped the setup.py hunk since that section was
refactored away and no longer contains the stale URL.)
Egavasyug pushed a commit to Egavasyug/hermes-agent that referenced this pull request Jun 10, 2026
…llback (NousResearch#3246)

Anthropic migrated their OAuth infrastructure from console.anthropic.com
to platform.claude.com (Claude Code v2.1.81+). Update _refresh_oauth_token()
to try the new endpoint first, falling back to the old one for tokens
issued before the migration.

Also switches Content-Type from application/x-www-form-urlencoded to
application/json to match current Claude Code behavior.

Salvaged from PR NousResearch#2741 by kshitijk4poor.
Egavasyug pushed a commit to Egavasyug/hermes-agent that referenced this pull request Jun 10, 2026
Anthropic migrated their developer console from console.anthropic.com
to platform.claude.com. Two user-facing display URLs were still pointing
to the old domain:

- hermes_cli/main.py — API key prompt in the Anthropic model flow
- run_agent.py — 401 troubleshooting output

The OAuth token refresh endpoint was already migrated in PR NousResearch#3246
(with fallback).

Spotted by @LucidPaths in PR NousResearch#3237.

(Salvage of NousResearch#3758 — dropped the setup.py hunk since that section was
refactored away and no longer contains the stale URL.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant