authx - If `Authorization:` header is disabled, then ignore it.
authorTim Otten <totten@civicrm.org>
Sat, 26 Feb 2022 00:21:29 +0000 (16:21 -0800)
committerTim Otten <totten@civicrm.org>
Mon, 25 Apr 2022 22:21:55 +0000 (15:21 -0700)
ext/authx/authx.php

index 220be9577aee573afdad7969e1ea826ff11269d1..ff3958a87007bfe2429644486c715d777b5b0302 100644 (file)
@@ -13,7 +13,7 @@ Civi::dispatcher()->addListener('civi.invoke.auth', function($e) {
     return (new \Civi\Authx\Authenticator())->auth($e, ['flow' => 'xheader', 'cred' => $_SERVER['HTTP_X_CIVI_AUTH'], 'siteKey' => $siteKey]);
   }
 
-  if (!empty($_SERVER['HTTP_AUTHORIZATION'])) {
+  if (!empty($_SERVER['HTTP_AUTHORIZATION']) && !empty(Civi::settings()->get('authx_header_cred'))) {
     return (new \Civi\Authx\Authenticator())->auth($e, ['flow' => 'header', 'cred' => $_SERVER['HTTP_AUTHORIZATION'], 'siteKey' => $siteKey]);
   }