private function OAuthServer::check_signature in OAuth 1.0 6
Same name and namespace in other branches
- 6.3 lib/OAuth.php \OAuthServer::check_signature()
- 7.3 lib/OAuth.php \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 ./
OAuth.php - process an access_token request returns the access token on success
- OAuthServer::fetch_request_token in ./
OAuth.php - process a request_token request returns the request token on success
- OAuthServer::verify_request in ./
OAuth.php - verify an api call, checks all the parameters
File
- ./
OAuth.php, line 585
Class
Code
private function check_signature(&$request, $consumer, $token, $signature = NULL) {
/*{{{*/
// 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);
/*
* this is commented out for Drupal implementation as it gives
* error messages with signature methods other than PLAIN TEXT for no reason
* It is working very fine without this method
*
if (!$valid_sig) {
throw new OAuthException("Invalid signature");
}
*/
}