mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-14 00:04:24 +00:00
Register SSO middleware if enabled in configuration
This commit is contained in:
@@ -191,6 +191,7 @@ ADLDAP_AUTH_FIELD=distinguishedname
|
|||||||
|
|
||||||
# Will allow SSO if your server provides an AUTH_USER field.
|
# Will allow SSO if your server provides an AUTH_USER field.
|
||||||
# You can set the following variables from a file by appending them with _FILE:
|
# You can set the following variables from a file by appending them with _FILE:
|
||||||
|
WINDOWS_SSO_ENABLED=false
|
||||||
WINDOWS_SSO_DISCOVER=samaccountname
|
WINDOWS_SSO_DISCOVER=samaccountname
|
||||||
WINDOWS_SSO_KEY=AUTH_USER
|
WINDOWS_SSO_KEY=AUTH_USER
|
||||||
|
|
||||||
|
@@ -26,6 +26,7 @@ use Illuminate\Support\Facades\Schema;
|
|||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
use Laravel\Passport\Passport;
|
use Laravel\Passport\Passport;
|
||||||
use URL;
|
use URL;
|
||||||
|
use Adldap\Laravel\Middleware\WindowsAuthenticate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
@@ -44,6 +45,9 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
if ('heroku' === config('app.env')) {
|
if ('heroku' === config('app.env')) {
|
||||||
URL::forceScheme('https');
|
URL::forceScheme('https');
|
||||||
}
|
}
|
||||||
|
if (config('ldap_auth.identifiers.windows.enabled', false)) {
|
||||||
|
$this->app['router']->pushMiddlewareToGroup('web', WindowsAuthenticate::class);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -217,6 +217,12 @@ return [
|
|||||||
| Windows Authentication Middleware (SSO)
|
| Windows Authentication Middleware (SSO)
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
|
| Enabled:
|
||||||
|
|
|
||||||
|
| The middleware will be registered only if enabled is set to true.
|
||||||
|
| If you update this file, beware, this is not a standard
|
||||||
|
| AdLdap2-Laravel configuration key.
|
||||||
|
|
|
||||||
| Locate Users By:
|
| Locate Users By:
|
||||||
|
|
|
|
||||||
| This value is the users attribute you would like to locate LDAP
|
| This value is the users attribute you would like to locate LDAP
|
||||||
@@ -239,6 +245,7 @@ return [
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
'windows' => [
|
'windows' => [
|
||||||
|
'enabled' => envNonEmpty('WINDOWS_SSO_ENABLED', false),
|
||||||
'locate_users_by' => envNonEmpty('WINDOWS_SSO_DISCOVER', 'samaccountname'),
|
'locate_users_by' => envNonEmpty('WINDOWS_SSO_DISCOVER', 'samaccountname'),
|
||||||
'server_key' => envNonEmpty('WINDOWS_SSO_KEY', 'AUTH_USER'),
|
'server_key' => envNonEmpty('WINDOWS_SSO_KEY', 'AUTH_USER'),
|
||||||
],
|
],
|
||||||
|
Reference in New Issue
Block a user