-
Notifications
You must be signed in to change notification settings - Fork 786
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid request error with MySQL & emulated prepares OFF #1089
Comments
I am glad to send a PR given consensus that there is
Otherwise I currently use the "fix" linked in the pull request above, and encourage anyone to do so, even that it is somewhat hardcore to override the used grant(s). |
Has this changed in v8 of oauth2-server? This never was giving issues before. |
Hey @driesvints. This hasn't changed for v8. I am assuming most people don't bother with turning off emulated prepares so this hasn't been raised as an issue before because no one has noticed it. |
Okay, let's see how we can get this fixed then. Probably type casting before sending in the parameter? |
Yeah I think that is the easiest way. Just ensure it is cast to an string in advance. Cheers Dries. |
Exactly. I tested it yesterday with Laravel 5.6.39, Passport 5.0.3 and OAuth2 Server 6.1.1 - same results. The thing why nobody bothered with turning emulated prepares off may well be the decade-old microsecond bug with native driver. |
It seems work was done on this back in Laravel 4.0 (#550), but it was not completely bulletproof. |
Description:
When not using emulated prepares on MySQL, you will always get "invalid_request" error because the client_id should be string, but is returned (properly) as an integer from the database
Steps To Reproduce:
in the database configuration
Note that I am somewhat certain that this issue should be present with other database drivers, I just have no means currently to check this.
NB: I tried to "fix" this issue in thephpleague/oauth2-server#1054 but @Sephster insisted on that this is primarily an implementation issue, which it actually is.
Thus I turned up here.
Please also see details of the underlying issue there.
The text was updated successfully, but these errors were encountered: