Check for REDIRECT_REMOTE_USER as well
This commit is contained in:
parent
5e22704f7e
commit
6b3476409a
3 changed files with 14 additions and 3 deletions
|
|
@ -124,7 +124,7 @@ class BasicAuth
|
|||
// workaround for HTTP-auth in CGI mode
|
||||
if (!empty($_SERVER['REDIRECT_REMOTE_USER'])) {
|
||||
$userpass = base64_decode(substr($_SERVER["REDIRECT_REMOTE_USER"], 6));
|
||||
if (strlen($userpass)) {
|
||||
if (!empty($userpass) && strpos($userpass, ':')) {
|
||||
list($name, $password) = explode(':', $userpass);
|
||||
$_SERVER['PHP_AUTH_USER'] = $name;
|
||||
$_SERVER['PHP_AUTH_PW'] = $password;
|
||||
|
|
|
|||
|
|
@ -83,6 +83,11 @@ class OAuth
|
|||
{
|
||||
$authorization = $_SERVER['HTTP_AUTHORIZATION'] ?? '';
|
||||
|
||||
if (empty($authorization)) {
|
||||
// workaround for HTTP-auth in CGI mode
|
||||
$authorization = $_SERVER['REDIRECT_REMOTE_USER'] ?? '';
|
||||
}
|
||||
|
||||
if (substr($authorization, 0, 7) != 'Bearer ') {
|
||||
return [];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue