/** * Get the signature method name, and if it is supported. * * @param JacobKiers\OAuth\Request\RequestInterface $request * * @return string Signature method name. * * @throws JacobKiers\OAuth\OAuthException */ private function getSignatureMethod(RequestInterface $request) { $signature_method = $request instanceof RequestInterface ? $request->getOAuthSignatureMethod() : null; if (!$signature_method) { // According to chapter 7 ("Accessing Protected Resources") the signature-method // parameter is required, and we can't just fallback to PLAINTEXT throw new OAuthException('No signature method parameter. This parameter is required'); } if (!in_array($signature_method, array_keys($this->signature_methods))) { throw new OAuthException("Signature method '{$signature_method}' not supported, try one of the following: " . implode(", ", array_keys($this->signature_methods))); } return $this->signature_methods[$signature_method]; }