From 700db14de27b97b36fcc407281015d14f8d95168 Mon Sep 17 00:00:00 2001 From: Julien Cassagne Date: Sat, 31 Oct 2020 18:46:01 -0400 Subject: [PATCH] Fix : Forward REMOTE_USER In remote_user_guard auth mode, fireflyiii wasn't receiving REMOTE_USER This issue occurs with docker image and standalone (when using apache) --- app/Support/Authentication/RemoteUserGuard.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Support/Authentication/RemoteUserGuard.php b/app/Support/Authentication/RemoteUserGuard.php index 7a333e7006..3f7b049253 100644 --- a/app/Support/Authentication/RemoteUserGuard.php +++ b/app/Support/Authentication/RemoteUserGuard.php @@ -67,9 +67,9 @@ class RemoteUserGuard implements Guard return; } - // Get the user identifier from $_SERVER + // Get the user identifier from $_SERVER or apache filtered headers $header = config('auth.guard_header', 'REMOTE_USER'); - $userID = request()->server($header) ?? null; + $userID = request()->server($header) ?? apache_request_headers()[$header] ?? null; if (null === $userID) { Log::error(sprintf('No user in header "%s".', $header)); throw new FireflyException('The guard header was unexpectedly empty. See the logs.');