25 $this->signature_methods[$signature_method->get_name()] = $signature_method;
46 $callback = $request->get_parameter(
'oauth_callback');
47 $new_token = $this->data_store->new_request_token(
$consumer, $callback);
69 $verifier = $request->get_parameter(
'oauth_verifier');
70 $new_token = $this->data_store->new_access_token($token,
$consumer, $verifier);
96 $version = $request->get_parameter(
"oauth_version");
103 throw new OAuthException(
"OAuth version '$version' not supported");
118 if (!$signature_method) {
121 throw new OAuthException(
'No signature method parameter. This parameter is required');
124 if (!in_array($signature_method,
125 array_keys($this->signature_methods))) {
127 "Signature method '$signature_method' not supported " .
128 'try one of the following: ' .
129 implode(
', ', array_keys($this->signature_methods))
133 return $this->signature_methods[$signature_method];
145 if (!$consumer_key) {
149 $consumer = $this->data_store->lookup_consumer($consumer_key);
166 $token = $this->data_store->lookup_token(
$consumer, $token_type, $token_field);
168 throw new OAuthException(
"Invalid $token_type token: $token_field");
194 $signature = $request->get_parameter(
'oauth_signature');
195 $valid_sig = $signature_method->check_signature($request,
$consumer, $token, $signature);
207 throw new OAuthException(
'Missing timestamp parameter. The parameter is required');
211 if (abs($now -
$timestamp) > $this->timestamp_threshold) {
212 throw new OAuthException(
"Expired timestamp, yours $timestamp, ours $now");
223 throw new OAuthException(
'Missing nonce parameter. The parameter is required');
verify_request(&$request)
verify an api call, checks all the parameters
check_timestamp($timestamp)
check that the timestamp is new enough
Class to represent an OAuth Exception.
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
fetch_request_token(&$request)
process a request_token request returns the request token on success
get_version(&$request)
version 1
get_consumer($request)
try to find the consumer for the provided request's consumer key
check_nonce($consumer, $token, $nonce, $timestamp)
check that the nonce is not repeated
get_signature_method($request)
figure out the signature with some defaults
Create styles array
The data for the language used.
Class to represent an OAuth Request.
foreach($mandatory_scripts as $file) $timestamp
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
Class to represent an OAuth Server.
fetch_access_token(&$request)
process an access_token request returns the access token on success
add_signature_method($signature_method)