fix: correctly send resource when exchanging code for the upstream to…#3013
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d7f52dddc3
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Test Failure AnalysisSummary: Static analysis failed due to type checking errors in files unrelated to this PR's changes. Root Cause: The type checker () found legitimate type errors in Suggested Solution: These errors exist on main and are not introduced by this PR. The PR only modifies Azure authentication files. The type errors should be fixed in a separate PR:
This PR should be mergeable - The failures are pre-existing issues on main, not regressions from these changes. Detailed AnalysisCI Errors Reported:
Why These Aren't False Positives:The type checker is correctly identifying that when you use Why This PR Isn't at Fault:
Why Tests Pass Locally:Type checking may pass locally with cached/incremental checking, but Related FilesFiles modified in this PR (all Azure auth related):
Files with pre-existing type errors (not in this PR):
Updated: 2026-01-28 - Corrected analysis after further investigation. Previous comment incorrectly attributed errors to stale cache. |
WalkthroughIntroduces a hook to prepare scopes used for the authorization-code → token exchange: OAuthProxy adds a private Possibly related PRs
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 398f88f405
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
I've resolved the comments and this is ready for review @jlowin. Let me know if you want anything changed or more information. :) |
…ken, allowing for consent flow with multiple resources # Conflicts: # tests/server/auth/providers/test_azure.py
37e5b4f to
132d32e
Compare
| result = provider._prepare_scopes_for_upstream_refresh([]) | ||
|
|
||
| assert "User.Read" in result | ||
| assert "User.Read" not in result # Not OIDC |
There was a problem hiding this comment.
This is correct btw, not an LLM oversight. We only want scopes for the appreg resource when we fetch or refresh tokens.
|
I've rebased main to resolve all the conflicts. |
|
Thanks @JonasKs! FWIW my claude agreed with your pushback on codex but apparently I didn't post that comment though I thought I did. |
|
@jlowin , I love when Claude agrees with me!! Thanks for quick reviews and merging everything. |
As explained here, if an MCP server wants to use OBO flow for multiple resources, and use consent flow, this does not work today.
This PR fixes this by correctly sending the correct scopes when exchanging auth code for the upstream token.
Note: Tests have been written by Claude Sonnet4.5 and reviewed by codex and gemini.
Contributors Checklist
Review Checklist