Definition at line 494 of file OAuth.php.
◆ __construct()
OAuthServer::__construct |
( |
|
$data_store | ) |
|
◆ add_signature_method()
OAuthServer::add_signature_method |
( |
|
$signature_method | ) |
|
Definition at line 507 of file OAuth.php.
509 $this->signature_methods[$signature_method->get_name()] =
◆ check_nonce()
OAuthServer::check_nonce |
( |
|
$consumer, |
|
|
|
$token, |
|
|
|
$nonce, |
|
|
|
$timestamp |
|
) |
| |
|
private |
check that the nonce is not repeated
Definition at line 699 of file OAuth.php.
References $timestamp, and $token.
702 $found = $this->data_store->lookup_nonce(
709 throw new OAuthException(
"Nonce already used: $nonce");
foreach($mandatory_scripts as $file) $timestamp
◆ check_signature()
OAuthServer::check_signature |
( |
& |
$request, |
|
|
|
$consumer, |
|
|
|
$token |
|
) |
| |
|
private |
all-in-one function to check the signature on a request should guess the signature method appropriately
Definition at line 651 of file OAuth.php.
References $OAuth_last_computed_signature, $timestamp, and $token.
655 $OAuth_last_computed_signature =
false;
657 $timestamp = @$request->get_parameter(
'oauth_timestamp');
658 $nonce = @$request->get_parameter(
'oauth_nonce');
665 $signature = $request->get_parameter(
'oauth_signature');
666 $valid_sig = $signature_method->check_signature(
674 $ex_text =
"Invalid signature";
675 if ($OAuth_last_computed_signature) {
676 $ex_text = $ex_text .
" ours= $OAuth_last_computed_signature yours=$signature";
678 throw new OAuthException($ex_text);
check_timestamp($timestamp)
check that the timestamp is new enough
check_nonce($consumer, $token, $nonce, $timestamp)
check that the nonce is not repeated
$OAuth_last_computed_signature
http://oauth.googlecode.com/svn/code/php/
get_signature_method(&$request)
figure out the signature with some defaults
foreach($mandatory_scripts as $file) $timestamp
◆ check_timestamp()
OAuthServer::check_timestamp |
( |
|
$timestamp | ) |
|
|
private |
check that the timestamp is new enough
Definition at line 685 of file OAuth.php.
References $timestamp.
689 if ($now -
$timestamp > $this->timestamp_threshold) {
690 throw new OAuthException(
691 "Expired timestamp, yours $timestamp, ours $now" foreach($mandatory_scripts as $file) $timestamp
◆ fetch_access_token()
OAuthServer::fetch_access_token |
( |
& |
$request | ) |
|
process an access_token request returns the access token on success
Definition at line 539 of file OAuth.php.
References $token.
551 $new_token = $this->data_store->new_access_token(
$token, $consumer);
check_signature(&$request, $consumer, $token)
all-in-one function to check the signature on a request should guess the signature method appropriate...
get_token(&$request, $consumer, $token_type="access")
try to find the token for the provided request's token key
get_version(&$request)
version 1
get_consumer(&$request)
try to find the consumer for the provided request's consumer key
◆ fetch_request_token()
OAuthServer::fetch_request_token |
( |
& |
$request | ) |
|
process a request_token request returns the request token on success
Definition at line 519 of file OAuth.php.
References $token.
530 $new_token = $this->data_store->new_request_token($consumer);
check_signature(&$request, $consumer, $token)
all-in-one function to check the signature on a request should guess the signature method appropriate...
get_version(&$request)
version 1
get_consumer(&$request)
try to find the consumer for the provided request's consumer key
◆ get_consumer()
OAuthServer::get_consumer |
( |
& |
$request | ) |
|
|
private |
try to find the consumer for the provided request's consumer key
Definition at line 612 of file OAuth.php.
614 $consumer_key = @$request->get_parameter(
"oauth_consumer_key");
615 if (!$consumer_key) {
616 throw new OAuthException(
"Invalid consumer key");
619 $consumer = $this->data_store->lookup_consumer($consumer_key);
621 throw new OAuthException(
"Invalid consumer");
◆ get_signature_method()
OAuthServer::get_signature_method |
( |
& |
$request | ) |
|
|
private |
figure out the signature with some defaults
Definition at line 589 of file OAuth.php.
592 @$request->get_parameter(
"oauth_signature_method");
593 if (!$signature_method) {
594 $signature_method =
"PLAINTEXT";
598 array_keys($this->signature_methods)
600 throw new OAuthException(
601 "Signature method '$signature_method' not supported " .
602 "try one of the following: " .
603 implode(
", ", array_keys($this->signature_methods))
606 return $this->signature_methods[$signature_method];
◆ get_token()
OAuthServer::get_token |
( |
& |
$request, |
|
|
|
$consumer, |
|
|
|
$token_type = "access" |
|
) |
| |
|
private |
try to find the token for the provided request's token key
Definition at line 630 of file OAuth.php.
References $token.
632 $token_field = @$request->get_parameter(
'oauth_token');
636 $token = $this->data_store->lookup_token(
642 throw new OAuthException(
"Invalid $token_type token: $token_field");
◆ get_version()
OAuthServer::get_version |
( |
& |
$request | ) |
|
|
private |
version 1
Definition at line 574 of file OAuth.php.
576 $version = $request->get_parameter(
"oauth_version");
581 throw new OAuthException(
"OAuth version '$version' not supported");
◆ verify_request()
OAuthServer::verify_request |
( |
& |
$request | ) |
|
verify an api call, checks all the parameters
Definition at line 559 of file OAuth.php.
References $OAuth_last_computed_signature, and $token.
562 $OAuth_last_computed_signature =
false;
567 return array($consumer,
$token);
check_signature(&$request, $consumer, $token)
all-in-one function to check the signature on a request should guess the signature method appropriate...
get_token(&$request, $consumer, $token_type="access")
try to find the token for the provided request's token key
$OAuth_last_computed_signature
http://oauth.googlecode.com/svn/code/php/
get_version(&$request)
version 1
get_consumer(&$request)
try to find the consumer for the provided request's consumer key
◆ $data_store
◆ $signature_methods
OAuthServer::$signature_methods = array() |
|
protected |
◆ $timestamp_threshold
OAuthServer::$timestamp_threshold = 300 |
|
protected |
◆ $version
OAuthServer::$version = 1.0 |
|
protected |
The documentation for this class was generated from the following file: