php-pm / php-pm-httpkernel

HttpKernel adapter for use of Symfony and Laravel frameworks with PHP-PM
MIT License
246 stars 72 forks source link

Laravel conversion to PSR Request does not work correctly #119

Closed Marko298 closed 6 years ago

Marko298 commented 6 years ago

Laravel Passport uses under the hood OAuth Server that requires PSR Request and laravel can convert it but does set parsed body because symphony requests misses it too

andig commented 6 years ago

I don‘t understand. Could you describe the issue more clearly?

Marko298 commented 6 years ago

If want to reproduce the error - just install Laravel Passport and try to issue a token On Jul 31, 2018, 17:47 +0300, andig notifications@github.com, wrote:

I don‘t understand. Could you describe the issue more clearly? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

andig commented 6 years ago

I would appreciate a detailled error message. Our laravel bridge is built on httpkernel, if laravel passport uses psr7 that won‘t work. The psr7 bridge might though.

andig commented 6 years ago

Ping @Marko298

Marko298 commented 6 years ago

Sorry, I was on vacation, haven`t seen your message. Laravel Router can convert Laravel HTTP Request to PSR Request. This convertion is used when your DI tries to make an instance of \Psr\Http\Message\ServerRequestInterface. The problem is that this parsed body of instance is empty. This breaks Laravel Passport completely. On Jul 31, 2018, 18:02 +0300, php-pm/php-pm-httpkernel , wrote:

I would appreciate a detailled error message. Our laravel bridge is built on httpkernel, if laravel passport uses psr7 that won‘t work. The psr7 bridge might though.

Marko298 commented 6 years ago

You can find it here https://github.com/illuminate/routing/blob/master/RoutingServiceProvider.php#L127 On Aug 4, 2018, 09:13 +0300, Mark Boychuk boychuk.m.n@gmail.com, wrote:

Sorry, I was on vacation, haven`t seen your message. Laravel Router can convert Laravel HTTP Request to PSR Request. This convertion is used when your DI tries to make an instance of \Psr\Http\Message\ServerRequestInterface. The problem is that this parsed body of instance is empty. This breaks Laravel Passport completely. On Jul 31, 2018, 18:02 +0300, php-pm/php-pm-httpkernel , wrote:

I would appreciate a detailled error message. Our laravel bridge is built on httpkernel, if laravel passport uses psr7 that won‘t work. The psr7 bridge might though.

andig commented 6 years ago

So you‘re essentially saying that the httpkernel bridge fails to populate the httprequest body?

Marko298 commented 6 years ago

Yup, you can test it easily yourself On Aug 4, 2018, 10:26 +0300, php-pm/php-pm-httpkernel reply@reply.github.com, wrote:

httpkernel bridge

andig commented 6 years ago

I have not use for passport personally. If you want to investigate where the httpkernel request construction fails I‘d be happy to look into providing a fix. For that you‘re on your own.

Marko298 commented 6 years ago

Ok I will try fix On Aug 4, 2018, 10:36 +0300, andig notifications@github.com, wrote:

I have not use for passport personally. If you want to investigate where the httpkernel request construction fails I‘d be happy to look into providing a fix. For that you‘re on your own. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

andig commented 6 years ago

See here https://github.com/php-pm/php-pm-httpkernel/issues/123#issuecomment-412092816. I suspect this might be the same issue.

Marko298 commented 6 years ago

Yup On Aug 10, 2018, 17:41 +0300, andig notifications@github.com, wrote:

See here

123 (comment). I suspect this might be the same issue.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.