Skip to content

Support localhost redirection with arbitrary port #4127

Description

@ston1th

Preflight checklist

Ory Network Project

No response

Describe your problem

In #1732 127.0.0.1 and [::1] were implemented to allow the usage of arbitrary ports.

Many MCP clients like claude code and others do not use 127.0.0.1 but localhost and generate a random port for the OAuth callback.
See this commit message: agentserver/agentserver@ff15f32

The MCP context possibly also relates to #4061

Describe your ideal solution

Could you please add localhost as a third allowed option alongside 127.0.0.1 and [::1] to use an arbitrary port.

I know, the RFC does not recommend doing this but there are many usecases that unfortunatly require it anyway: https://datatracker.ietf.org/doc/html/rfc8252#section-8.3

Other OAuth implementations e.g. Microsoft Entra ID do support it.
Also there are WSL (Windows Subsystem for Linux) network configurations that do only work using localhost and do not work with 127.0.0.1.

Workarounds or alternatives

None.

Version

v26.0.2

Additional Context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featNew feature or request.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions