Repository navigation
Conversation
The loopback path was hardcoded in two places that must agree: the redirect_uri advertised during registration and the local callback listener. Some IdPs (e.g. Okta) only accept an exact pre-registered redirect URI, which may not use the default /oauth/callback path. Both now derive from one --callback-path flag, defaulting to /oauth/callback so existing setups are unaffected. Generated with Claude Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
--callback-pathflag so the OAuth loopback path is configurable.The path was hardcoded to
/oauth/callbackin two places that must agree: theredirect_urisent during client registration (NodeOAuthClientProvider) and the path the local callback server listens on (coordinateAuth). Authorization servers such as Okta only accept a redirect URI that exactly matches a pre-registered one, and that URI does not always use/oauth/callback. With no way to change it, the redirect landed on a path the proxy did not serve and login never completed.One flag now feeds both. It defaults to
/oauth/callback, so existing setups are unaffected. A value without a leading slash gets one.Changes
parseCommandLineArgsparses--callback-pathand adds it to the positional-arg skip list.createLazyAuthCoordinatorandcoordinateAuthtake the path and pass it tosetupOAuthCallbackServerWithLongPoll. Defaulted, so existing four-argument callers and tests are unchanged.proxy.tsandclient.tsthread it to the coordinator and toNodeOAuthClientProvider, which already accepted acallbackPathoption that nothing set.Tests
Unit tests for the arg parsing (default, explicit, missing leading slash, positional-arg handling) and for the provider's
redirect_uri.npm run test:unit: 213 passed.🤖 Generated with Claude Code