3 namespace BookStack\Providers;
6 use BookStack\Api\ApiTokenGuard;
7 use BookStack\Auth\Access\LdapService;
8 use Illuminate\Support\ServiceProvider;
10 class AuthServiceProvider extends ServiceProvider
13 * Bootstrap the application services.
17 public function boot()
19 Auth::extend('api-token', function ($app, $name, array $config) {
20 return new ApiTokenGuard($app['request']);
25 * Register the application services.
29 public function register()
31 Auth::provider('ldap', function ($app, array $config) {
32 return new LdapUserProvider($config['model'], $app[LdapService::class]);