You are here

private function OAuthServer::check_signature in jQuery social stream 8

Same name and namespace in other branches
  1. 8.2 src/Twitter/OAuthServer.php \Drupal\jquery_social_stream\Twitter\OAuthServer::check_signature()

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

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

File

src/Twitter/OAuthServer.php, line 153

Class

OAuthServer

Namespace

Drupal\jquery_social_stream\Twitter

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 OAuthException("Invalid signature");
  }
}