fix: remove colon from actorId to prevent OAuth code parse failure#77
fix: remove colon from actorId to prevent OAuth code parse failure#77chitcommit merged 2 commits intomainfrom
Conversation
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ❌ Deployment failed View logs |
chittyconnect | 54088da | Mar 19 2026, 12:59 AM |
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughModified the userId construction pattern in the OAuth provider from colon-separated to hyphen-separated format and added inline documentation explaining encoding constraints and authorization code derivation. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~4 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Fixes OAuth token exchange failures by ensuring the per-actor userId used during authorization completion does not introduce an extra : delimiter into the provider’s authorization-code encoding format.
Changes:
- Replace the
mcp-client:${clientId}actorId format withmcp-client-${clientId}to avoid embedding:inuserId. - Add inline documentation explaining why
userIdmust not contain colons.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/middleware/oauth-provider.js`:
- Line 128: The actorId construction uses oauthReqInfo.clientId directly which
allows colons to break the authorization code format; change construction and
any place that composes the authorization code (the code string built from
userId:grantId:secret) to use an encoded clientId (e.g., base64 or
encodeURIComponent) instead of the raw oauthReqInfo.clientId, update the
decoding/validation path that splits the authorization code (the code validation
logic that expects "userId:grantId:secret") to decode the clientId after
splitting, and ensure all references to actorId and authorization-code
composition/validation (look for oauthReqInfo.clientId, actorId, and the
authorization code split/validate functions) are updated consistently so colons
in client IDs cannot break parsing.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: efc75e36-d104-41e9-a0ae-770deaa4a16f
📒 Files selected for processing (1)
src/middleware/oauth-provider.js
44cd306 to
bfd8ba2
Compare
The OAuthProvider encodes authorization codes as userId:grantId:secret and splits on : expecting exactly 3 parts. Using mcp-client:clientId created 4 parts and broke token exchange. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
bfd8ba2 to
ef7bf5c
Compare
…failure The OAuthProvider encodes authorization codes as userId:grantId:secret and validates by splitting on ":" expecting exactly 3 parts. The previous fix used a dash instead of a colon between the "mcp-client" prefix and the clientId, but the clientId itself could also contain colons (from dynamic client registration). Strip all colons from the clientId before use. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
OAuth token exchange was broken: actorId used mcp-client:clientId which added a 4th colon to the authorization code. OAuthProvider expects userId:grantId:secret (3 parts). Fixed by using dash separator instead. After deploy, MCP should reconnect via OAuth PKCE.
Summary by CodeRabbit