-
Notifications
You must be signed in to change notification settings - Fork 782
Closed
Labels
Description
- Passport Version: 11.3.0
- Laravel Version: 9.42.2
- PHP Version: 8.1.13
- Database Driver & Version: mysql 8.0.30
Description:
I followed the documentation for Passport to implement "Authorization Code Grant with PKCE". When I am trying to send a GET request to /oauth/authorize, I get the following error message:
Laravel\\Passport\\Http\\Controllers\\AuthorizationController::__construct(): Argument #3 ($guard) must be of type Illuminate\\Contracts\\Auth\\StatefulGuard, Laravel\\Passport\\Guards\\TokenGuard given
What I found in the source code was, that with the PR 1577 the Laravel\\Passport\\Http\\Controllers\\AuthorizationController
now has a third parameter with the type of Illuminate\\Contracts\\Auth\\StatefulGuard
. The problem is, the only guard in this package (which is bound in the Laravel\Passport\PassportServiceProvider
) is the TokenGuard - which does not implement the StatefulGuard interface.
I totally expect that I am missing something important here, but for now I think this is a bug.
Steps To Reproduce:
As stated in the documentation:
- Install laravel/passport
- In
config/app.php
setguards.api.driver
topassport
'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],
'api' => [
'driver' => 'passport',
'provider' => 'users',
],
],
- Create a client:
php artisan passport:client --public
with ID set to1
and default values for name and redirect - Make a GET request (I used postman) to
/oauth/authorize
- I tested with and without the query parameters, both give the same error response