Changeset View
Changeset View
Standalone View
Standalone View
src/app/Providers/AuthServiceProvider.php
<?php | <?php | ||||
namespace App\Providers; | namespace App\Providers; | ||||
use App\Auth\LDAPUserProvider; | use App\Auth\LDAPUserProvider; | ||||
use Illuminate\Support\Facades\Auth; | use Illuminate\Support\Facades\Auth; | ||||
use Illuminate\Support\Facades\Gate; | use Illuminate\Support\Facades\Gate; | ||||
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; | use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; | ||||
use Laravel\Passport\Passport; | |||||
class AuthServiceProvider extends ServiceProvider | class AuthServiceProvider extends ServiceProvider | ||||
{ | { | ||||
/** | /** | ||||
* The policy mappings for the application. | * The policy mappings for the application. | ||||
* | * | ||||
* @var array | * @var array | ||||
*/ | */ | ||||
Show All 11 Lines | public function boot() | ||||
$this->registerPolicies(); | $this->registerPolicies(); | ||||
Auth::provider( | Auth::provider( | ||||
'ldap', | 'ldap', | ||||
function ($app, array $config) { | function ($app, array $config) { | ||||
return new LDAPUserProvider($app['hash'], $config['model']); | return new LDAPUserProvider($app['hash'], $config['model']); | ||||
} | } | ||||
); | ); | ||||
//Hashes all secrets and thus makes them non-recoverable | |||||
/* Passport::hashClientSecrets(); */ | |||||
Passport::routes(); | |||||
Passport::tokensExpireIn(now()->addMinutes(\config('auth.token_expiry_minutes'))); | |||||
Passport::refreshTokensExpireIn(now()->addMinutes(\config('auth.refresh_token_expiry_minutes'))); | |||||
Passport::personalAccessTokensExpireIn(now()->addMonths(6)); | |||||
} | } | ||||
} | } |