为什么Laravel Passport不会生成OAuth路线?
我有一个清洁的Laravel 9.2的安装。
composer require laravel/passport
然后,我运行迁移并安装护照。
php artisan migrate
php artisan passport:install
所有这些都应该生成必要的身份验证路线?
但是路线列表没有护照路线。
php artisan route:list
获取|头 / .......................................................................................... ................................................................................. ......... 邮政_ignition/execute-solution .. ignition.executesLoute› spatie \ larVallignition› executesLouteController 获取|头_IGNITION/HEALTH-CHECK ............................................................. HEADEATION CHECK› SPATIE \ LARVALVIGNITION› HealthCheckController 发布_IGNITION/update-config ....................... ignition.updateconfig› spatie \ larvellignition› updateConfigController 获取|头部圣所/csrf-cookie ........................................................................................ 。
I have a clean installation of Laravel 9.2.
composer require laravel/passport
Then I run the migrations and install passport.
php artisan migrate
php artisan passport:install
All of that should generate the necessary routes for authentication?
But route list does not have passport routes.
php artisan route:list
GET|HEAD / .........................................................................................................
POST _ignition/execute-solution .. ignition.executeSolution › Spatie\LaravelIgnition › ExecuteSolutionController
GET|HEAD _ignition/health-check .............. ignition.healthCheck › Spatie\LaravelIgnition › HealthCheckController
POST _ignition/update-config ........... ignition.updateConfig › Spatie\LaravelIgnition › UpdateConfigController
GET|HEAD sanctum/csrf-cookie ........................................... Laravel\Sanctum › CsrfCookieController@show
Did I missed something to work it properly?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
PHP Artisan Passport:Install
您应该在 boot 方法appport 方法
app> app \ providers \ providers \ authserviceProvider中调用
。此方法将注册发出访问令牌并撤销访问令牌,客户端和个人访问令牌所需的路线:Passport ::路由
方法检查软件包 docs 。
after
php artisan passport:install
you should call thePassport::routes
method within the boot method of yourApp\Providers\AuthServiceProvider
. This method will register the routes necessary to issue access tokens and revoke access tokens, clients, and personal access tokens:check the package docs for more details.