Download the PHP package serendipity_hq/oauth-guzzle-middleware without Composer
On this page you can find all versions of the php package serendipity_hq/oauth-guzzle-middleware. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download serendipity_hq/oauth-guzzle-middleware
More information about serendipity_hq/oauth-guzzle-middleware
Files in serendipity_hq/oauth-guzzle-middleware
Package oauth-guzzle-middleware
Short Description OAuth middleware for Guzzle (6+)
License MIT
Homepage http://guzzlephp.org/
Informations about the package oauth-guzzle-middleware
Guzzle 6+ OAuth Middleware
Signs HTTP requests using OAuth.
This version only works with Guzzle 6.0 and up!
(Forked from https://github.com/guzzle/oauth-subscriber and separated from original repo to be able to use continuous integration server and other analysis tools).
Installing
Requires PHP OAuth extension.
This project can be installed using Composer. Add the following to your
composer.json
:
{
"require": {
"serendipity_hq/oauth-guzzle-middleware": "~0.1"
}
}
About OAuth
From OAuth Core 1.0a:
The OAuth protocol enables websites or applications (Consumers) to access Protected Resources from a web service (Service Provider) via an API, without requiring Users to disclose their Service Provider credentials to the Consumers. More generally, OAuth creates a freely-implementable and generic methodology for API authentication.
An example use case is allowing printing service printer.example.com (the Consumer), to access private photos stored on photos.example.net (the Service Provider) without requiring Users to provide their photos.example.net credentials to printer.example.com.
OAuth does not require a specific user interface or interaction pattern, nor does it specify how Service Providers authenticate Users, making the protocol ideally suited for cases where authentication credentials are unavailable to the Consumer, such as with OpenID.
OAuth aims to unify the experience and implementation of delegated web service authentication into a single, community-driven protocol. OAuth builds on existing protocols and best practices that have been independently implemented by various websites. An open standard, supported by large and small providers alike, promotes a consistent and trusted experience for both application developers and the users of those applications.
OAuth Versions
- [2007] OAuth Core 1.0 ([DEPRECATED] Community - OAuth.net)
- [2009] OAuth Core 1.0a (Community - OAuth.net)
- [2010] OAuth Protocol 1.0 (Informational - RFC5849)
- [2012] OAuth Protocol 2.0 (Standards Track - RFC6749)
This library supports
- OAuth Core 1.0a
- OAuth Protocol 1.0 (to implement)
- OAuth Protocol 2.0 (to implement)
How to use the OAuth Core 1.0a Middleware
You can send both 2-legged and 3-legged Requests
by passing or not the token
and token_secret
values to the
OAuth*
middleware.
See the Terminology paragraph on hueniverse.com for more information about n-legged requests.
For a full working example see the Twitter example.
Send a 3-legged Request
To authenticate only a single Request
with OAuth middleware, remove the RequestOptions::AUTH => 'oauth'
option from
the $clientParams
array and put it into a $requestParams
array:
Send a 2-legged Request
To send 2-legged Requests
simply omit token
and token_secret
parameters.