/**
  * Register any authentication / authorization services.
  *
  * @return void
  */
 public function boot()
 {
     $this->registerPolicies();
     Passport::routes();
     Passport::tokensExpireIn(Carbon::now()->addDays(1));
     Passport::refreshTokensExpireIn(Carbon::now()->addDays(2));
     Passport::pruneRevokedTokens();
 }
예제 #2
0
 /**
  * @return void
  */
 public function register()
 {
     Passport::cookie('notadd_token');
     $this->registerAuthorizationServer();
     $this->registerResourceServer();
     $this->registerGuard();
     $this->app->singleton('api', function ($app) {
         return new Passport($app, $app['events']);
     });
 }
 /**
  * Register any authentication / authorization services.
  *
  * @return void
  */
 public function boot()
 {
     $this->registerPolicies();
     Passport::routes();
     // Token Lifetimes
     //        Passport::tokensExpireIn(Carbon::now()->addDays(15));
     // Refresh Token Lifetimes
     //        Passport::refreshTokensExpireIn(Carbon::now()->addDays(30));
     // Pruning Revoked Tokens
     //        Passport::pruneRevokedTokens();
     // Token Scopes
     //        Passport::tokensCan([
     //            'place-orders' => 'Place orders',
     //            'check-status' => 'Check order status',
     //        ]);
 }
예제 #4
0
 /**
  * Parse scopes for authorization request.
  *
  * @param \League\OAuth2\Server\RequestTypes\AuthorizationRequest $authRequest
  *
  * @return array
  */
 protected function parseScopes(AuthorizationRequest $authRequest)
 {
     return Passport::scopesFor(collect($authRequest->getScopes())->map(function ($scope) {
         return $scope->getIdentifier();
     })->all());
 }
예제 #5
0
 /**
  * Register any authentication / authorization services.
  *
  * @return void
  */
 public function boot()
 {
     $this->registerPolicies();
     Passport::routes();
 }
예제 #6
-1
 /**
  * Register any authentication / authorization services.
  *
  * @return void
  */
 public function boot()
 {
     Passport::ignoreMigrations();
     Passport::tokensExpireIn(Carbon::now()->addDays(1));
     Passport::refreshTokensExpireIn(Carbon::now()->addMonths(3));
     if ($path = config('services.passport.path')) {
         Passport::keyPath($path);
     }
     Passport::routes();
 }