feat: Allow hard-coded redirect URL#9
Merged
Conversation
The external CLI's OAuth clients are configured to only allow callback URLs that contain a specific port & "localhost" (not 127.0.0.1) as the hostname. Allow that to be specified.
There was a problem hiding this comment.
Pull request overview
Adds an optional with_redirect_uri builder to PkceAuthProvider so the OAuth redirect_uri sent to the authorization server (and used during code exchange) can be overridden — e.g., to use http://localhost:{port}/callback for OAuth clients that allowlist localhost instead of 127.0.0.1. The local callback listener still binds to 127.0.0.1; only the port and callback path are derived from the configured URI, and wait_for_callback now validates the request path against the configured callback path.
Changes:
- New
redirect_uri: Option<String>field withwith_redirect_uribuilder, pluseffective_redirect_uri/parse_redirect_urihelpers used in bothrun_pkce_flowandexchange_code_for_token. wait_for_callbacktakes anexpected_pathargument and returns 404 for non-matching paths, with a newextract_request_pathhelper.- Unit tests covering default URI, override behavior, port/path parsing, and request path extraction.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
axburgess-godaddy
approved these changes
May 29, 2026
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.
The external CLI's OAuth clients are configured to only allow callback URLs that contain a specific port & "localhost" (not 127.0.0.1) as the hostname. Allow that to be specified to avoid the OAuth webpage showing a 403 error.
#authz-supportthread for context.