Fix unhandled possible redirect_uris field usage in Client Model #1872
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.
This Bugfix adds consideration of the newly added redirect_uris field in Oauth Clients Table. This new field was introduced with Passport 13. If you decided to switch to new oauth_clients table fields you will stumble over the described problem.
Behaviour without fix:
If you are using the Oauth Register Route in Laravel MCP to register a new Client you send the request:
The Register Request:
POST oauth/register
Body:
{"client_name":"Test","redirect_uris":["https://test1.com", "https://test2.com"]}
Response:
{
"client_id": "51",
"grant_types": [
"authorization_code",
"implicit",
"refresh_token",
"urn:ietf:params:oauth:grant-type:device_code"
],
"response_types": [
"code"
],
"redirect_uris": [],
"scope": "mcp:use",
"token_endpoint_auth_method": "none"
}
Problem: redirect_uris are empty because of the missing consideration of a potential redirect_uris field (instead of the old redirect field).
Behaviour with fix:
The Register Request:
POST oauth/register
Body:
{"client_name":"Test","redirect_uris":["https://test1.com", "https://test2.com"]}
Response:
{
"client_id": "51",
"grant_types": [
"authorization_code",
"implicit",
"refresh_token",
"urn:ietf:params:oauth:grant-type:device_code"
],
"response_types": [
"code"
],
"redirect_uris": [
"https://test1.com",
"https://test2.com"
],
"scope": "mcp:use",
"token_endpoint_auth_method": "none"
}
The Redirect URIs are now correctly returned!
Side Effects of the Bug
This Bug currently does lead to non working MCP Oauth Workflow with Anthropic Claude. OpenAI instead seems to have no problems with the missing redirect_uris in the response.