LTI Tool Provider Library  3.0.2
PHP class library for building LTI Tool Providers
OAuthRequest Class Reference

Class to represent an OAuth Request. More...

Public Member Functions

 __construct ($http_method, $http_url, $parameters=null)
 
 set_parameter ($name, $value, $allow_duplicates=true)
 
 get_parameter ($name)
 
 get_parameters ()
 
 unset_parameter ($name)
 
 get_signable_parameters ()
 The request parameters, sorted and concatenated into a normalized string. More...
 
 get_signature_base_string ()
 Returns the base string of this request. More...
 
 get_normalized_http_method ()
 just uppercases the http method More...
 
 get_normalized_http_url ()
 parses the url and rebuilds it to be scheme://host/path More...
 
 to_url ()
 builds a url usable for a GET request More...
 
 to_postdata ()
 builds the data one would send in a POST request More...
 
 to_header ($realm=null)
 builds the Authorization: header More...
 
 __toString ()
 
 sign_request ($signature_method, $consumer, $token)
 
 build_signature ($signature_method, $consumer, $token)
 

Static Public Member Functions

static from_request ($http_method=null, $http_url=null, $parameters=null)
 attempt to build up a request from what was passed to the server More...
 
static from_consumer_and_token ($consumer, $token, $http_method, $http_url, $parameters=null)
 pretty much a helper function to set up the request More...
 

Data Fields

 $base_string
 

Static Public Attributes

static $version = '1.0'
 
static $POST_INPUT = 'php://input'
 

Protected Attributes

 $parameters
 
 $http_method
 
 $http_url
 

Detailed Description

Class to represent an OAuth Request.

Version
2008-08-04
Licence:
https://opensource.org/licenses/MIT The MIT License

Definition at line 12 of file OAuthRequest.php.

Constructor & Destructor Documentation

__construct (   $http_method,
  $http_url,
  $parameters = null 
)

Member Function Documentation

__toString ( )

Definition at line 251 of file OAuthRequest.php.

References OAuthRequest\to_url().

build_signature (   $signature_method,
  $consumer,
  $token 
)

Definition at line 268 of file OAuthRequest.php.

Referenced by OAuthRequest\sign_request().

static from_consumer_and_token (   $consumer,
  $token,
  $http_method,
  $http_url,
  $parameters = null 
)
static

pretty much a helper function to set up the request

Definition at line 87 of file OAuthRequest.php.

References OAuthRequest\$http_method, OAuthRequest\$http_url, OAuthRequest\$parameters, and OAuthRequest\$version.

Referenced by ToolConsumer\addSignature(), ResourceLink\fromRecordId(), and ToolConsumer\signParameters().

static from_request (   $http_method = null,
  $http_url = null,
  $parameters = null 
)
static

attempt to build up a request from what was passed to the server

Definition at line 36 of file OAuthRequest.php.

References OAuthRequest\$http_method, OAuthRequest\$http_url, OAuthRequest\$parameters, OAuthUtil\get_headers(), OAuthUtil\parse_parameters(), and OAuthUtil\split_header().

Referenced by ToolProvider\onError().

get_normalized_http_method ( )

just uppercases the http method

Definition at line 173 of file OAuthRequest.php.

Referenced by OAuthRequest\get_signature_base_string().

get_normalized_http_url ( )

parses the url and rebuilds it to be scheme://host/path

Definition at line 181 of file OAuthRequest.php.

Referenced by OAuthRequest\get_signature_base_string(), and OAuthRequest\to_url().

get_parameter (   $name)

Definition at line 119 of file OAuthRequest.php.

Referenced by OAuthServer\verify_request().

get_parameters ( )

Definition at line 123 of file OAuthRequest.php.

References OAuthRequest\$parameters.

get_signable_parameters ( )

The request parameters, sorted and concatenated into a normalized string.

Returns
string

Definition at line 135 of file OAuthRequest.php.

References OAuthRequest\$parameters, and OAuthUtil\build_http_query().

Referenced by OAuthRequest\get_signature_base_string().

get_signature_base_string ( )

Returns the base string of this request.

The base string defined as the method, the url and the parameters (normalized), each urlencoded and the concated with &.

Definition at line 157 of file OAuthRequest.php.

References OAuthRequest\get_normalized_http_method(), OAuthRequest\get_normalized_http_url(), OAuthRequest\get_signable_parameters(), and OAuthUtil\urlencode_rfc3986().

set_parameter (   $name,
  $value,
  $allow_duplicates = true 
)

Definition at line 103 of file OAuthRequest.php.

Referenced by OAuthRequest\sign_request().

sign_request (   $signature_method,
  $consumer,
  $token 
)
to_header (   $realm = null)

builds the Authorization: header

Definition at line 224 of file OAuthRequest.php.

References OAuthUtil\urlencode_rfc3986().

to_postdata ( )

builds the data one would send in a POST request

Definition at line 217 of file OAuthRequest.php.

References OAuthUtil\build_http_query().

Referenced by OAuthRequest\to_url().

to_url ( )

builds a url usable for a GET request

Definition at line 202 of file OAuthRequest.php.

References OAuthRequest\get_normalized_http_url(), and OAuthRequest\to_postdata().

Referenced by OAuthRequest\__toString().

unset_parameter (   $name)

Definition at line 127 of file OAuthRequest.php.

Field Documentation

$base_string

Definition at line 18 of file OAuthRequest.php.

$http_method
protected
$http_url
protected
$POST_INPUT = 'php://input'
static

Definition at line 20 of file OAuthRequest.php.

$version = '1.0'
static

Definition at line 19 of file OAuthRequest.php.

Referenced by OAuthRequest\from_consumer_and_token().


The documentation for this class was generated from the following file: