Downloads
Stars
Version
composer require nova-ad-auth
Add package provider after Nova provider in app.php
'providers' => [
...
App\Providers\NovaServiceProvider::class,
Klepak\NovaAdAuth\AdAuthenticationServiceProvider::class,
];
Add to EventServiceProvider
use Adldap\Laravel\Events\AuthenticatedWithWindows;
use Klepak\NovaAdAuth\Listeners\SynchronizeUserPermissions;
use Klepak\NovaAdAuth\Listeners\SynchronizeUserThumbnail;
...
protected $listen = [
...
AuthenticatedWithWindows::class => [
SynchronizeUserPermissions::class,
SynchronizeUserThumbnail::class,
],
];
Add route middleware in Kernel.php
protected $routeMiddleware = [
...
'auth.sso' => \Adldap\Laravel\Middleware\WindowsAuthenticate::class,
'role' => \Spatie\Permission\Middlewares\RoleMiddleware::class,
'permission' => \Spatie\Permission\Middlewares\PermissionMiddleware::class,
];
Publish assets
php artisan vendor:publish --provider="Klepak\NovaAdAuth\AdAuthenticationServiceProvider" --force
NOTE: this will replace your existing auth and adldap config
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<security>
<authentication>
<windowsAuthentication enabled="true" />
<anonymousAuthentication enabled="false" />
</authentication>
</security>
<rewrite>
<rules>
<clear />
<rule name="Rewrite" enabled="true" stopProcessing="true">
<match url="^(?!storage)" ignoreCase="false" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" appendQueryString="true" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>