]> BookStack Code Mirror - bookstack/blobdiff - app/Providers/AuthServiceProvider.php
added missing comma that caused the testprocess to fail.
[bookstack] / app / Providers / AuthServiceProvider.php
index 0b299551aa5d7e7f1dc643f7581446cada86a21c..fe52df1686cec7ac00bcd82ba14a1c74b0b5f3dd 100644 (file)
@@ -6,7 +6,9 @@ use Auth;
 use BookStack\Api\ApiTokenGuard;
 use BookStack\Auth\Access\ExternalBaseUserProvider;
 use BookStack\Auth\Access\Guards\LdapSessionGuard;
+use BookStack\Auth\Access\Guards\Saml2SessionGuard;
 use BookStack\Auth\Access\LdapService;
+use BookStack\Auth\Access\RegistrationService;
 use BookStack\Auth\UserRepo;
 use Illuminate\Support\ServiceProvider;
 
@@ -30,7 +32,17 @@ class AuthServiceProvider extends ServiceProvider
                 $provider,
                 $this->app['session.store'],
                 $app[LdapService::class],
-                $app[UserRepo::class]
+                $app[RegistrationService::class]
+            );
+        });
+
+        Auth::extend('saml2-session', function ($app, $name, array $config) {
+            $provider = Auth::createUserProvider($config['provider']);
+            return new Saml2SessionGuard(
+                $name,
+                $provider,
+                $this->app['session.store'],
+                $app[RegistrationService::class]
             );
         });
     }