Definition at line 552 of file OAuth.php.
◆ __construct()
OAuthServer::__construct |
( |
|
$data_store | ) |
|
◆ add_signature_method()
OAuthServer::add_signature_method |
( |
|
$signature_method | ) |
|
Definition at line 565 of file OAuth.php.
567 $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 772 of file OAuth.php.
References $timestamp, and PHPMailer\PHPMailer\$token.
775 throw new OAuthException(
776 'Missing nonce parameter. The parameter is required' 781 $found = $this->data_store->lookup_nonce(
788 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 721 of file OAuth.php.
References $request, $timestamp, and PHPMailer\PHPMailer\$token.
725 ?
$request->get_parameter(
'oauth_timestamp')
728 ?
$request->get_parameter(
'oauth_nonce')
736 $signature =
$request->get_parameter(
'oauth_signature');
737 $valid_sig = $signature_method->check_signature(
745 throw new OAuthException(
"Invalid signature");
check_timestamp($timestamp)
check that the timestamp is new enough
foreach($paths as $path) $request
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 752 of file OAuth.php.
References $timestamp.
755 throw new OAuthException(
756 'Missing timestamp parameter. The parameter is required' 762 if (abs($now -
$timestamp) > $this->timestamp_threshold) {
763 throw new OAuthException(
764 "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 599 of file OAuth.php.
References $request, and PHPMailer\PHPMailer\$token.
611 $verifier =
$request->get_parameter(
'oauth_verifier');
612 $new_token = $this->data_store->new_access_token(
$token, $consumer, $verifier);
foreach($paths as $path) $request
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 577 of file OAuth.php.
References $request, and PHPMailer\PHPMailer\$token.
589 $callback =
$request->get_parameter(
'oauth_callback');
590 $new_token = $this->data_store->new_request_token($consumer, $callback);
foreach($paths as $path) $request
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 676 of file OAuth.php.
References $request.
679 ?
$request->get_parameter(
"oauth_consumer_key")
682 if (!$consumer_key) {
683 throw new OAuthException(
"Invalid consumer key");
686 $consumer = $this->data_store->lookup_consumer($consumer_key);
688 throw new OAuthException(
"Invalid consumer");
foreach($paths as $path) $request
◆ get_signature_method()
OAuthServer::get_signature_method |
( |
|
$request | ) |
|
|
private |
figure out the signature with some defaults
Definition at line 650 of file OAuth.php.
References $request.
653 ?
$request->get_parameter(
"oauth_signature_method")
656 if (!$signature_method) {
659 throw new OAuthException(
'No signature method parameter. This parameter is required');
662 if (!in_array($signature_method,
663 array_keys($this->signature_methods))) {
664 throw new OAuthException(
665 "Signature method '$signature_method' not supported " .
666 "try one of the following: " .
667 implode(
", ", array_keys($this->signature_methods))
670 return $this->signature_methods[$signature_method];
foreach($paths as $path) $request
◆ 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 697 of file OAuth.php.
References $request, and PHPMailer\PHPMailer\$token.
700 ?
$request->get_parameter(
'oauth_token')
703 if (!empty($token_field)) {
704 $token = $this->data_store->lookup_token(
705 $consumer, $token_type, $token_field
708 throw new OAuthException(
"Invalid $token_type token: $token_field");
foreach($paths as $path) $request
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 633 of file OAuth.php.
References $request, and $version.
642 throw new OAuthException(
"OAuth version '$version' not supported");
foreach($paths as $path) $request
◆ verify_request()
OAuthServer::verify_request |
( |
& |
$request | ) |
|
verify an api call, checks all the parameters
Definition at line 620 of file OAuth.php.
References $request, and PHPMailer\PHPMailer\$token.
626 return array($consumer,
$token);
foreach($paths as $path) $request
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
◆ $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