Skip to content

[Access] Document dynamic loopback OAuth callback ports - #34342

Draft
kennyj42 wants to merge 2 commits into
productionfrom
kjohnson/oauth-loopback-callback-ports
Draft

kennyj42 wants to merge 2 commits into
productionfrom
kjohnson/oauth-loopback-callback-ports

Conversation

@kennyj42

Copy link
Copy Markdown
Collaborator

Summary

Documents dynamic loopback callback ports for Managed OAuth and MCP portal clients, including IPv6 loopback, port-only matching, and the authorization-time callback required at token exchange.

Keeps client callbacks separate from upstream server callbacks and adds a changelog entry.

Documentation checklist

  • Includes a changelog entry.
  • The change adheres to the documentation style guide.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://kjohnson-oauth-loopback-callback-ports.previews.developers.cloudflare.com (commit 47c6d03)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://af16ee78.previews.developers.cloudflare.com 47c6d03 2026-10-16T21:58:54.043Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://dd129de9.previews.developers.cloudflare.com c071e43 2026-10-14T21:56:04.090Z Visit the dashboard ↗

@cloudflare-docs-bot

Copy link
Copy Markdown
Contributor

⚠️ @kennyj42 This pull request adds a changelog entry dated in the past:

  • src/content/changelog/access/2026-10-14-oauth-loopback-callback-ports.mdx — dated 2026-10-14

Typically, changelog entries should be dated the day they merge. This is not blocking — if the date is unintentional, please update it.

http://127.0.0.1:49152/callback
```

Only the port can change. The scheme, host, path, and query must match exactly. The exception applies to `127.0.0.1`, `[::1]`, and explicitly registered `localhost` callbacks. Public clients must use PKCE with `S256`. If the port changes, the token exchange must include the exact `redirect_uri` used during authorization.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we do want a changelog for this, we should probably call out that the port does need to remain the same between authorization and token exchange.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Public clients must use PKCE with S256

I would call out more clearly that this constraint only applies to the loosening of port checks

- `[::1]`
- `localhost`, when explicitly registered

Only the port can change. The scheme (`http` or `https`), host, path, and query must match the registered URI exactly. For example, a client registered with `http://127.0.0.1:3000/callback` can authorize with `http://127.0.0.1:49152/callback`, but not `http://localhost:49152/callback` or a different callback path. Non-loopback redirect URIs still require an exact registered match.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above, port can only change during registration. it needs to be consistent between token exchange an authorization

@cloudflare cloudflare deleted a comment from github-actions Bot Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants