From 026cf36f13a3a9defacab35070809be102d948c3 Mon Sep 17 00:00:00 2001 From: Hafez Divandari Date: Thu, 8 Feb 2024 20:23:49 +0330 Subject: [PATCH 1/2] enable password grant --- passport.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/passport.md b/passport.md index db5915134bb..a912cfff063 100644 --- a/passport.md +++ b/passport.md @@ -658,6 +658,16 @@ If the state parameter matches, the consumer should issue a `POST` request to yo The OAuth2 password grant allows your other first-party clients, such as a mobile application, to obtain an access token using an email address / username and password. This allows you to issue access tokens securely to your first-party clients without requiring your users to go through the entire OAuth2 authorization code redirect flow. +To enable the grant, call the `enablePasswordGrant` method in the `boot` method of your application's `App\Providers\AuthServiceProvider` class: + + /** + * Register any authentication / authorization services. + */ + public function boot(): void + { + Passport::enablePasswordGrant(); + } + ### Creating a Password Grant Client From cbb8542fe11db18c4f937c610aaa5ac52469fb6b Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 9 Feb 2024 09:12:27 -0600 Subject: [PATCH 2/2] Update passport.md --- passport.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/passport.md b/passport.md index a912cfff063..0b3f72df107 100644 --- a/passport.md +++ b/passport.md @@ -658,10 +658,10 @@ If the state parameter matches, the consumer should issue a `POST` request to yo The OAuth2 password grant allows your other first-party clients, such as a mobile application, to obtain an access token using an email address / username and password. This allows you to issue access tokens securely to your first-party clients without requiring your users to go through the entire OAuth2 authorization code redirect flow. -To enable the grant, call the `enablePasswordGrant` method in the `boot` method of your application's `App\Providers\AuthServiceProvider` class: +To enable the password grant, call the `enablePasswordGrant` method in the `boot` method of your application's `App\Providers\AppServiceProvider` class: /** - * Register any authentication / authorization services. + * Bootstrap any application services. */ public function boot(): void {