Uh oh!
There was an error while loading. Please reload this page.
fix: allow custom URI schemes in OAuth Dynamic Client Registration - #2286
fix: allow custom URI schemes in OAuth Dynamic Client Registration#2286ItsYash1421 wants to merge 8 commits into
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
cemalkilic
commented
Dec 16, 2025
Hi @ItsYash1421, thank you for opening this PR! 🙏 There seems to be a bit of confusion here. There are two different redirect URL systems:
Closing this PR in favor of #2298, but really appreciate you taking the time to help! |
What kind of change does this PR introduce?
Bug fix - Fixes OAuth Dynamic Client Registration to support custom URI schemes
What is the current behavior?
Issue:#2285
The OAuth 2.0 Dynamic Client Registration endpoint (
POST /oauth/clients/register) rejects custom URI schemes (e.g.,cursor://,exp://,myapp://) even when they are explicitly whitelisted in theadditional_redirect_urlsconfiguration orGOTRUE_URI_ALLOW_LISTenvironment variable.Current Error
{ "code": 400, "error_code": "validation_failed", "msg": "400: invalid redirect_uri 'cursor://anysphere.cursor-mcp/callback': scheme must be HTTPS or HTTP (localhost only)" }Root Cause
The OAuth server's client registration logic uses strict validation that only allows
httpandhttpsschemes, which is inconsistent with PR #711 that relaxed this validation for general auth flows to support native applications.What is the new behavior?
The OAuth server now uses the same allow-list-based validation as the rest of the auth system (introduced in PR #711). Custom URI schemes work when explicitly configured in the allow list.
Test Results
All validation tests pass successfully:
![Test Results]



Additional context
Changes Made
Files Modified:
internal/api/oauthserver/service.go(~40 lines)validateRedirectURI()to useutilities.IsRedirectURLValid()Servermethods for config accessvalidate()methods to accept*Serverparameterinternal/api/oauthserver/service_test.go(~80 lines)TestRedirectURIValidation()to use new method signatureTestCustomURISchemes()testSetupTest()to configure test URIsReferences