You are here

private function OAuthServer::check_nonce 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_nonce()

check that the nonce is not repeated

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

File

src/Twitter/OAuthServer.php, line 198

Class

OAuthServer

Namespace

Drupal\jquery_social_stream\Twitter

Code

private function check_nonce($consumer, $token, $nonce, $timestamp) {
  if (!$nonce) {
    throw new OAuthException('Missing nonce parameter. The parameter is required');
  }

  // verify that the nonce is uniqueish
  $found = $this->data_store
    ->lookup_nonce($consumer, $token, $nonce, $timestamp);
  if ($found) {
    throw new OAuthException("Nonce already used: {$nonce}");
  }
}