You are here

public function LingotekOAuthRequestVerifier::verifySignature in Lingotek Translation 7.5

Same name and namespace in other branches
  1. 7.7 lib/oauth-php/library/LingotekOAuthRequestVerifier.php \LingotekOAuthRequestVerifier::verifySignature()
  2. 7.4 lib/oauth-php/library/LingotekOAuthRequestVerifier.php \LingotekOAuthRequestVerifier::verifySignature()
  3. 7.6 lib/oauth-php/library/LingotekOAuthRequestVerifier.php \LingotekOAuthRequestVerifier::verifySignature()

* Verify the signature of the request, using the method in oauth_signature_method. * The signature is returned encoded in the form as used in the url. So the base64 and * urlencoding has been done. * *

Parameters

string consumer_secret: * @param string token_secret * @exception OAuthException2 thrown when the signature method is unknown * @exception OAuthException2 when not all parts available * @exception OAuthException2 when signature does not match

1 call to LingotekOAuthRequestVerifier::verifySignature()
LingotekOAuthRequestVerifier::verifyExtended in lib/oauth-php/library/LingotekOAuthRequestVerifier.php
* Verify the request * *

File

lib/oauth-php/library/LingotekOAuthRequestVerifier.php, line 233

Class

LingotekOAuthRequestVerifier

Code

public function verifySignature($consumer_secret, $token_secret, $token_type = 'access') {
  $required = array(
    'oauth_consumer_key',
    'oauth_signature_method',
    'oauth_timestamp',
    'oauth_nonce',
    'oauth_signature',
  );
  if ($token_type !== false) {
    $required[] = 'oauth_token';
  }
  foreach ($required as $req) {
    if (!isset($this->param[$req])) {
      throw new OAuthException2('Can\'t verify request signature, missing parameter "' . $req . '"');
    }
  }
  $this
    ->checks();
  $base = $this
    ->signatureBaseString();
  $this
    ->verifyDataSignature($base, $consumer_secret, $token_secret, $this->param['oauth_signature_method'], $this->param['oauth_signature']);
}