You are here

private function OAuthServer::check_nonce in OAuth 1.0 6.3

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

check that the nonce is not repeated

1 call to OAuthServer::check_nonce()
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 714
OAuth 1.0 server and client library.

Class

OAuthServer

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}");
  }
}