From 5d58abf1e516f869c762512ce5b3c3a125a5b180 Mon Sep 17 00:00:00 2001 From: Bartek Fabiszewski Date: Mon, 24 Apr 2017 14:47:25 +0200 Subject: [PATCH] Include WWW-Authenticate header with 401 response --- auth.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/auth.php b/auth.php index 2359717..9f302d4 100755 --- a/auth.php +++ b/auth.php @@ -45,6 +45,7 @@ if (!$user->isValid && (uConfig::$require_authentication || defined('headless')) // not authenticated and username not submited // load form if (defined('headless')) { + header('WWW-Authenticate: OAuth realm="users@ulogger"'); header('HTTP/1.1 401 Unauthorized', true, 401); } else { print @@ -115,6 +116,7 @@ if (!$user->isValid && (uConfig::$require_authentication || defined('headless')) } session_destroy(); if (defined('headless')) { + header('WWW-Authenticate: OAuth realm="users@ulogger"'); header('HTTP/1.1 401 Unauthorized', true, 401); } else { $url = str_replace("//", "/", $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']) . "/index.php");