DarkaOnLine / L5-Swagger

OpenApi or Swagger integration to Laravel
https://github.com/DarkaOnLine/L5-Swagger
MIT License
2.66k stars 397 forks source link

Authorization Code Grant with PKCE - how to? #485

Closed DriverCat closed 2 years ago

DriverCat commented 2 years ago

Description:

Does this package has support for Laravel Passport Authorization Code Grant with PKCE flow? I tried authorizationCode with PKCE, but it doesnt work.

Steps To Reproduce:

Click Authorize button, Client ID field not exists. Also tried accessCode, but seems like it is some other flow, because it doesnt generate code_challenge param needed for Authorization Code Grant with PKCE.

My current config:

'passport' => [ // Unique name of security
                    'type' => 'oauth2', // The type of the security scheme. Valid values are "basic", "apiKey" or "oauth2".
                    'description' => 'Laravel passport oauth2 security.',
                    'in' => 'header',
                    'scheme' => 'https',
                    'flows' => [
                        "authorizationCode with PKCE" => [
                            "authorizationUrl" => config('app.url') . '/oauth/authorize',
                            "tokenUrl" => config('app.url') . '/oauth/token',
                            "refreshUrl" => config('app.url') . '/token/refresh',
                            "scopes" => []
                        ],
                    ],
                ],
DarkaOnLine commented 2 years ago

Fixed with #486