diff --git a/src/Socialbox/Socialbox.php b/src/Socialbox/Socialbox.php index 703e05a..52ae74f 100644 --- a/src/Socialbox/Socialbox.php +++ b/src/Socialbox/Socialbox.php @@ -122,12 +122,6 @@ return false; } - if(!$clientRequest->headerExists(StandardHeaders::SIGNING_PUBLIC_KEY)) - { - self::returnError(400, StandardError::BAD_REQUEST, 'Missing required header: ' . StandardHeaders::SIGNING_PUBLIC_KEY->value); - return false; - } - if(!$clientRequest->headerExists(StandardHeaders::ENCRYPTION_PUBLIC_KEY)) { self::returnError(400, StandardError::BAD_REQUEST, 'Missing required header: ' . StandardHeaders::ENCRYPTION_PUBLIC_KEY->value); @@ -146,6 +140,12 @@ return false; } + if(!$clientRequest->getIdentifyAs()->isExternal() && !$clientRequest->headerExists(StandardHeaders::SIGNING_PUBLIC_KEY)) + { + self::returnError(400, StandardError::BAD_REQUEST, 'Missing required header: ' . StandardHeaders::SIGNING_PUBLIC_KEY->value); + return false; + } + return true; }