Skip to content

feat: support dynamic port matching for localhost redirect URIs#1

Merged
keegancsmith merged 1 commit into
sourcegraph:masterfrom
roncodingenthusiast:feat/localhost-loopback-port-matching
Apr 17, 2026
Merged

feat: support dynamic port matching for localhost redirect URIs#1
keegancsmith merged 1 commit into
sourcegraph:masterfrom
roncodingenthusiast:feat/localhost-loopback-port-matching

Conversation

@keegancsmith
Copy link
Copy Markdown
Member

Cherry-picking ory#874

Add localhost handling to isLoopbackAddress so that native OAuth 2.0
clients registering http://localhost/callback can use dynamic ports
(e.g. http://localhost:54321/callback) per RFC 8252 Section 7.3.

Previously, isLoopbackAddress only used net.ParseIP which returns nil
for the hostname "localhost", preventing port-flexible loopback
matching. The existing hostname equality check in isMatchingAsLoopback
prevents cross-matching between localhost and IP literals.

Closes ory#873

Made-with: Cursor
@keegancsmith keegancsmith merged commit b9b5f2c into sourcegraph:master Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants