You are here

private function OAuthServer::get_signature_method in OAuth 1.0 7.3

Same name and namespace in other branches
  1. 6.3 lib/OAuth.php \OAuthServer::get_signature_method()
  2. 6 OAuth.php \OAuthServer::get_signature_method()

figure out the signature with some defaults

1 call to OAuthServer::get_signature_method()
OAuthServer::check_signature in lib/OAuth.php
all-in-one function to check the signature on a request should guess the signature method appropriately

File

lib/OAuth.php, line 600
OAuth 1.0 server and client library.

Class

OAuthServer

Code

private function get_signature_method($request) {
  $signature_method = $request instanceof OAuthRequest ? $request
    ->get_parameter("oauth_signature_method") : NULL;
  if (!$signature_method) {

    // According to chapter 7 ("Accessing Protected Ressources") 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];
}