Skip to content

add $client to resolveUserByProviderCredentials#55

Open
maximepvrt wants to merge 4 commits intocoderello:masterfrom
maximepvrt:patch-1
Open

add $client to resolveUserByProviderCredentials#55
maximepvrt wants to merge 4 commits intocoderello:masterfrom
maximepvrt:patch-1

Conversation

@maximepvrt
Copy link

Added instructions for updating oauth_clients table.

@ankurk91
Copy link
Collaborator

can you explain why we need to add instructions here?

@maximepvrt
Copy link
Author

@ankurk91, without adding this grant, I get this error :

{
    "error": "unauthorized_client",
    "error_description": "The authenticated client is not authorized to use this authorization grant type."
}

@ankurk91
Copy link
Collaborator

Ok.
Explain this line :
Finally, add the grant social to the grant_types array attribute for all clients that need it in the oauth_clients table.

Which file you are talking about?

@maximepvrt
Copy link
Author

It means you have to add the social grant directly in your database, specifically, in the grant_types column of the oauth_clients table.

Capture d’écran 2025-10-28 à 10 11 35

That’s why I mentioned the warning below: if you were using v12 before, you’ll need to migrate your data model accordingly.

@maximepvrt maximepvrt marked this pull request as draft October 28, 2025 13:08
@maximepvrt
Copy link
Author

@ankurk91 I was previously using https://github.com/adaojunior/passport-social-grant, but since the project is no longer maintained, I suggest archiving it and migrating to your library instead: adaojunior/passport-social-grant#58.

In this MR, I’ve added what’s essential for my use case — access to the client instance — because depending on the client, I don’t want to allow the same social providers.

Also, the password grant should actually use the same class as the social grant (as seen here: https://github.com/coderello/laravel-passport-social-grant/pull/55/files#diff-6118de6459321a628f4735097dd2b79cbfef6042a532317224fe6d424b46b129L48-R49).

@maximepvrt maximepvrt changed the title Update README with oauth_clients table instructions add client to resolveUserByProviderCredentials Oct 28, 2025
@maximepvrt maximepvrt changed the title add client to resolveUserByProviderCredentials add $client to resolveUserByProviderCredentials Oct 28, 2025
@maximepvrt maximepvrt marked this pull request as ready for review October 28, 2025 21:50
@maximepvrt
Copy link
Author

@ankurk91 did you see my reply ?

@ankurk91
Copy link
Collaborator

ankurk91 commented Nov 7, 2025

i am still not confident with the changes you made, you made some breaking changes too

@maximepvrt
Copy link
Author

@ankurk91 You're right : this PR would indeed introduce breaking changes, as it modifies the interface signature. It would therefore require releasing a v5.

That said, this change helps maintain consistency with Laravel Passport, which also introduced the client parameter in the latest version for the password grant flow : laravel/passport#1866

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