REQUEST_METHOD_HEADER
REQUEST_METHOD_HEADER = 'header'
Consumer request method constants. See http://oauth.net/core/1.0/#consumer_req_param
OAuth signing plugin
$config : \Guzzle\Common\Collection
__construct(array $config)
Create a new OAuth 1.0 plugin
array | $config | Configuration array containing these parameters:
|
getSubscribedEvents() : array
Returns an array of event names this subscriber wants to listen to.
The array keys are event names and the value can be:
For instance:
The event names to listen to
onRequestBeforeSend(\Guzzle\Common\Event $event) : array
Request before-send event handler
\Guzzle\Common\Event | $event | Event received |
getSignature(\Guzzle\Http\Message\RequestInterface $request, integer $timestamp, string $nonce) : string
Calculate signature for request
\Guzzle\Http\Message\RequestInterface | $request | Request to generate a signature for |
integer | $timestamp | Timestamp to use for nonce |
string | $nonce |
getStringToSign(\Guzzle\Http\Message\RequestInterface $request, integer $timestamp, string $nonce) : string
Calculate string to sign
\Guzzle\Http\Message\RequestInterface | $request | Request to generate a signature for |
integer | $timestamp | Timestamp to use for nonce |
string | $nonce |
getParamsToSign(\Guzzle\Http\Message\RequestInterface $request, integer $timestamp, string $nonce) : array
Get all of the parameters required to sign a request including: * The oauth params * The request GET params * The params passed in the POST body (with a content-type of application/x-www-form-urlencoded)
\Guzzle\Http\Message\RequestInterface | $request | Request to generate a signature for |
integer | $timestamp | Timestamp to use for nonce |
string | $nonce |
shouldPostFieldsBeSigned( $request) : boolean
Decide whether the post fields should be added to the base string that Oauth signs.
This implementation is correct. Non-conformant APIs may require that this method be overwritten e.g. the Flickr API incorrectly adds the post fields when the Content-Type is 'application/x-www-form-urlencoded'
$request |
Whether the post fields should be signed or not
generateNonce(\Guzzle\Http\Message\RequestInterface $request) : string
Returns a Nonce Based on the unique id and URL. This will allow for multiple requests in parallel with the same exact timestamp to use separate nonce's.
\Guzzle\Http\Message\RequestInterface | $request | Request to generate a nonce for |
getTimestamp(\Guzzle\Common\Event $event) : integer
Gets timestamp from event or create new timestamp
\Guzzle\Common\Event | $event | Event containing contextual information |
getOauthParams( $timestamp, $nonce) : \Guzzle\Common\Collection
Get the oauth parameters as named by the oauth spec
$timestamp | ||
$nonce |