PHPoAuthLib
NOTE: I'm looking for someone who could help to maintain this package alongside me, just because I don't have a ton of time to devote to it. However, I'm still going to keep trying to pay attention to PRs, etc., (*1)
PHPoAuthLib provides oAuth support in PHP 5.3+ and is very easy to integrate with any project which requires an oAuth client., (*2)
, (*3)
Installation
This library can be found on Packagist.
The recommended way to install this is through composer., (*4)
Edit your composer.json
and add:, (*5)
{
"require": {
"lusitanian/oauth": "~0.3"
}
}
And install dependencies:, (*6)
$ curl -sS https://getcomposer.org/installer | php
$ php composer.phar install
Features
- PSR-0 compliant for easy interoperability
- Fully extensible in every facet.
- You can implement any service with any custom requirements by extending the protocol version's
AbstractService
implementation.
- You can use any HTTP client you desire, just create a class utilizing it which implements
OAuth\Common\Http\ClientInterface
(two implementations are included)
- You can use any storage mechanism for tokens. By default, session, in-memory and Redis.io (requires PHPRedis) storage mechanisms are included. Implement additional mechanisms by implementing
OAuth\Common\Token\TokenStorageInterface
.
Service support
The library supports both oAuth 1.x and oAuth 2.0 compliant services. A list of currently implemented services can be found below., (*7)
Included service implementations
- OAuth1
- 500px
- BitBucket
- Etsy
- FitBit
- Flickr
- QuickBooks
- Scoop.it!
- Tumblr
- Twitter
- Xing
- Yahoo
- OAuth2
- Amazon
- BitLy
- Bitrix24
- Box
- Buffer
- Dailymotion
- Delicious
- Deezer
- DeviantArt
- Dropbox
- Eve Online
- Facebook
- Foursquare
- GitHub
- Google
- Harvest
- Heroku
- Hubic
- Instagram
- Jawbone UP
- LinkedIn
- Mailchimp
- Microsoft
- Mondo
- Nest
- Netatmo
- Parrot Flower Power
- PayPal
- Pinterest
- Pocket
- Reddit
- RunKeeper
- Salesforce
- SoundCloud
- Spotify
- Strava
- Ustream
- Vimeo
- Vkontakte
- Yahoo
- Yammer
- more to come!
Examples
Examples of basic usage are located in the examples/ directory., (*8)
Usage
For usage with complete auth flow, please see the examples. More in-depth documentation will come with release 1.0., (*9)
Framework Integration
- Lithium: Sébastien Charrier has written an adapter for the library.
- Laravel 4: Dariusz PrzÄ
da has written a service provider for the library.
- Laravel 5: Valentin IvaĆcu ported Dariusz PrzÄ
da's Laravel 4 library to Laravel 5.
- Symfony: Alexander Pinnecke has written a Symfony Bundle for the library.
Extensions
- Extract normalized user data from OAuth Services with the library PHPoAuthUserData by Luciano Mammino
Tests
To run the tests, you must install dependencies with composer install --dev
, (*10)