Skip to content

Allow OAuth client registration without a client name - #254

Merged
pushpak1300 merged 3 commits into
laravel:mainfrom
lazerg:fix/issue-253-optional-client-name
Jun 25, 2026
Merged

Allow OAuth client registration without a client name#254
pushpak1300 merged 3 commits into
laravel:mainfrom
lazerg:fix/issue-253-optional-client-name

Conversation

@lazerg

@lazerg lazerg commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

RFC 7591 §2 lists client_name as an OPTIONAL field for Dynamic Client Registration, but OAuthRegisterController rejects any registration that omits both client_name and the legacy name, returning 400 invalid_client_metadata. This blocks spec-compliant clients — notably Claude's remote MCP connector, whose registration request leaves out client_name and currently fails with "Couldn't register with … sign-in service".

This PR makes client_name/name optional. When neither is supplied, the client name falls back to the host of the first redirect URI (e.g. example.com), and to MCP Client when no host can be derived. The existing client_name > name precedence is unchanged, so requests that already send a name behave exactly as before.

Tests are updated to cover a registration request without a name and the fallback behaviour.

Fixes #253

@lazerg

lazerg commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

cc @pushpak1300 — since you built the OAuth/DCR layer in #233, this is likely your area. Small change to make client_name optional per RFC 7591 §2, which lets Claude's remote connector register (its DCR request omits client_name). Tests, Pint, PHPStan (level 8) and Rector all pass locally; CI is just waiting on the first-time-contributor approval. Thanks for taking a look!

@taylorotwell

Copy link
Copy Markdown
Member

Thanks for your pull request to Laravel!

I appreciate you taking the time to submit this; however, it appears this contribution may have been primarily AI-generated without careful human review and consideration.

We've found that AI-generated code often doesn't align well with Laravel's conventions, architectural decisions, and the specific context of what we're trying to accomplish with the framework. Quality contributions require thoughtful human insight into the codebase.

If you're interested in contributing to Laravel, I'd encourage you to familiarize yourself with the existing codebase, engage with the community, and submit PRs that reflect your own understanding and careful consideration of the problem you're solving.

@pushpak1300 pushpak1300 reopened this Jun 25, 2026
@pushpak1300

Copy link
Copy Markdown
Member

Thanks.

@pushpak1300
pushpak1300 merged commit 0c32bf3 into laravel:main Jun 25, 2026
22 checks passed
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.

OAuth DCR rejects registrations without client_name, contrary to RFC 7591 (breaks Claude connector)

3 participants