You are here

private function sOAuthServer::check_signature in jQuery social stream 7

Same name and namespace in other branches
  1. 7.2 jquery_social_stream.js.inc \sOAuthServer::check_signature()

all-in-one function to check the signature on a request should guess the signature method appropriately

3 calls to sOAuthServer::check_signature()
sOAuthServer::fetch_access_token in ./jquery_social_stream.js.inc
process an access_token request returns the access token on success
sOAuthServer::fetch_request_token in ./jquery_social_stream.js.inc
process a request_token request returns the request token on success
sOAuthServer::verify_request in ./jquery_social_stream.js.inc
verify an api call, checks all the parameters

File

./jquery_social_stream.js.inc, line 961
JS callbacks.

Class

sOAuthServer

Code

private function check_signature(&$request, $consumer, $token) {

  // this should probably be in a different method
  $timestamp = @$request
    ->get_parameter('oauth_timestamp');
  $nonce = @$request
    ->get_parameter('oauth_nonce');
  $this
    ->check_timestamp($timestamp);
  $this
    ->check_nonce($consumer, $token, $nonce, $timestamp);
  $signature_method = $this
    ->get_signature_method($request);
  $signature = $request
    ->get_parameter('oauth_signature');
  $valid_sig = $signature_method
    ->check_signature($request, $consumer, $token, $signature);
  if (!$valid_sig) {
    throw new sOAuthException("Invalid signature");
  }
}