@@ -401,3 +401,34 @@ To enable it, simply set the option to true in your `adldap_auth.php` configurat
401401``` php
402402'login_fallback' => false, // Set to true.
403403```
404+
405+ #### Windows Authentication (SSO) Middleware
406+
407+ > ** Note** : This feature was introduced in ` v1.4.3 ` . You will need to re-publish the Adldap Auth configuration file
408+ to receive this option.
409+
410+ > ** Requirements** : This feature assumes that you have enabled ` Windows Authentication ` in IIS, or have enabled it
411+ in some other means with Apache. Adldap does not set this up for you. To enable Windows Authentication, visit:
412+ https://www.iis.net/configreference/system.webserver/security/authentication/windowsauthentication/providers/add
413+
414+ SSO authentication allows you to authenticate your users by the pre-populated ` $_SERVER['AUTH_USER'] ` (or ` $_SERVER['REMOTE_USER ` ] )
415+ that is filled when users visit your site when SSO is enabled on your server. This is configurable in your ` adldap_auth.php `
416+ configuration file.
417+
418+ To use the middleware, insert it on your middleware stack:
419+
420+ ``` php
421+ protected $middlewareGroups = [
422+ 'web' => [
423+ Middleware\EncryptCookies::class,
424+ \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
425+ \Illuminate\Session\Middleware\StartSession::class,
426+ \Illuminate\View\Middleware\ShareErrorsFromSession::class,
427+ Middleware\VerifyCsrfToken::class,
428+ \Adldap\Laravel\Middleware\WindowsAuthenticate::class, // Inserted here.
429+ ],
430+ ];
431+ ```
432+
433+ Now when you visit your site, a user account will be created (if one doesn't exist already)
434+ with a random password and then automatically logged in. Neat huh?
0 commit comments