protected function getClientCredentials(array $inputData, array $authHeaders)
{
// Basic Authentication is used
if (!empty($authHeaders['PHP_AUTH_USER'])) {
return array($authHeaders['PHP_AUTH_USER'], $authHeaders['PHP_AUTH_PW']);
} elseif (empty($inputData['client_id'])) {
// No credentials were specified
throw new OAuth2ServerException(self::HTTP_BAD_REQUEST, self::ERROR_INVALID_CLIENT, 'Client id was not found in the headers or body');
} else {
// This method is not recommended, but is supported by specification
$client_id = $inputData['client_id'];
$client_secret = isset($inputData['client_secret']) ? $inputData['client_secret'] : null;
return array($client_id, $client_secret);
}
}