Skip to content

fix: get_identity 403 in Cloud OAuth mode - #198

Closed
zzstoatzz wants to merge 1 commit into
mainfrom
fix-oauth-identity-403
Closed

fix: get_identity 403 in Cloud OAuth mode#198
zzstoatzz wants to merge 1 commit into
mainfrom
fix-oauth-identity-403

Conversation

@zzstoatzz

Copy link
Copy Markdown
Collaborator

this PR makes get_identity work in Cloud OAuth mode when a workspace_id is passed — it previously fell through to the account-level Cloud identity path and failed with 403: MCP OAuth tokens require a consented workspace-scoped Cloud API path on /accounts/{account_id}.

details
  • OAuth access tokens are workspace-scoped and cannot call account-level endpoints (/me/, /accounts/{id}), so get_identity now always returns the OAuth grant description (with selected_workspace when a workspace_id is given) whenever an OAuth token is present
  • removes the now-unreachable service-account CloudUnauthorizedError fallback inside the Cloud path
  • observed live against the hosted MCP server: get_identity(workspace_id=...) returned the 403 in both consented workspaces

🤖 Generated with Claude Code

OAuth access tokens are workspace-scoped and cannot call account-level
endpoints like /me/ or /accounts/{id}. get_identity only short-circuited
to the OAuth grant description when workspace_id was None, so passing a
workspace_id fell through to the full Cloud identity path and failed
with 403 on /accounts/{account_id}.

Always describe the OAuth grant when an OAuth token is present, and
drop the now-unreachable service-account fallback.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

📊 Observability

View eval run traces in Logfire: prefect-mcp-server-evals @ 62c4365

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

Evaluation Results

20 tests  ±0    6 ✅  - 13   3m 47s ⏱️ -20s
 1 suites ±0    0 💤 ± 0 
 1 files   ±0   14 ❌ +13 

For more details on these failures, see this check.

Results for commit 62c4365. ± Comparison against base commit 2940a3e.

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