Definition at line 509 of file OAuth.php.
◆ __construct()
OAuthServer::__construct |
( |
|
$data_store | ) |
|
◆ add_signature_method()
OAuthServer::add_signature_method |
( |
|
$signature_method | ) |
|
Definition at line 520 of file OAuth.php.
521 $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 716 of file OAuth.php.
References $consumer, and $timestamp.
718 throw new OAuthException(
719 'Missing nonce parameter. The parameter is required' 723 $found = $this->data_store->lookup_nonce(
730 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 668 of file OAuth.php.
References $consumer, $timestamp, and OAuthRequest\get_parameter().
682 $signature = $request->get_parameter(
'oauth_signature');
683 $valid_sig = $signature_method->check_signature(
691 throw new OAuthException(
"Invalid signature");
check_timestamp($timestamp)
check that the timestamp is new enough
check_nonce($consumer, $token, $nonce, $timestamp)
check that the nonce is not repeated
foreach($mandatory_scripts as $file) $timestamp
get_signature_method($request)
figure out the signature with some defaults
◆ check_timestamp()
OAuthServer::check_timestamp |
( |
|
$timestamp | ) |
|
|
private |
check that the timestamp is new enough
Definition at line 698 of file OAuth.php.
References $timestamp, and time.
700 throw new OAuthException(
701 'Missing timestamp parameter. The parameter is required' 706 if (abs($now -
$timestamp) > $this->timestamp_threshold) {
707 throw new OAuthException(
708 "Expired timestamp, yours $timestamp, ours $now" foreach($mandatory_scripts as $file) $timestamp
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
◆ fetch_access_token()
OAuthServer::fetch_access_token |
( |
& |
$request | ) |
|
process an access_token request returns the access token on success
Definition at line 552 of file OAuth.php.
References $consumer.
563 $verifier = $request->get_parameter(
'oauth_verifier');
564 $new_token = $this->data_store->new_access_token($token,
$consumer, $verifier);
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_token($request, $consumer, $token_type="access")
try to find the token for the provided request's token key
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 531 of file OAuth.php.
References $consumer.
542 $callback = $request->get_parameter(
'oauth_callback');
543 $new_token = $this->data_store->new_request_token(
$consumer, $callback);
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 625 of file OAuth.php.
References $consumer, and OAuthRequest\get_parameter().
630 if (!$consumer_key) {
631 throw new OAuthException(
"Invalid consumer key");
634 $consumer = $this->data_store->lookup_consumer($consumer_key);
636 throw new OAuthException(
"Invalid consumer");
◆ get_signature_method()
OAuthServer::get_signature_method |
( |
|
$request | ) |
|
|
private |
figure out the signature with some defaults
Definition at line 600 of file OAuth.php.
References OAuthRequest\get_parameter().
605 if (!$signature_method) {
608 throw new OAuthException(
'No signature method parameter. This parameter is required');
611 if (!in_array($signature_method,
612 array_keys($this->signature_methods))) {
613 throw new OAuthException(
614 "Signature method '$signature_method' not supported " .
615 "try one of the following: " .
616 implode(
", ", array_keys($this->signature_methods))
619 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 645 of file OAuth.php.
References $consumer, and OAuthRequest\get_parameter().
650 if (!empty($token_field)) {
651 $token = $this->data_store->lookup_token(
655 throw new OAuthException(
"Invalid $token_type token: $token_field");
OAuth PECL extension includes an OAuth Exception class, so we need to wrap the definition of this cla...
◆ get_version()
OAuthServer::get_version |
( |
& |
$request | ) |
|
|
private |
version 1
Definition at line 584 of file OAuth.php.
References $version.
585 $version = $request->get_parameter(
"oauth_version");
592 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 572 of file OAuth.php.
References $consumer, and array.
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
Create styles array
The data for the language used.
get_token($request, $consumer, $token_type="access")
try to find the token for the provided request's token key
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:
- libs/composer/vendor/simplesamlphp/simplesamlphp/modules/oauth/libextinc/OAuth.php