pasadinhas/oauth
Composer 安装命令:
composer require pasadinhas/oauth
包简介
PHP 5.4+ OAuth (1 and 2) client library
README 文档
README
php-oauth-lib provides OAuth support in PHP 5.4+ and is very easy to integrate with any project which requires an OAuth client.
Installation
This library can be found on Packagist. The recommended way to install this is through composer.
Edit your composer.json and add:
{
"require": {
"pasadinhas/oauth": "~1.0.0"
}
}
And then update your dependencies with:
$ composer update
Extend this package
If you implement any new Service, HTTP Client or Storage, make a pull request so I can add it to this package. Don't forget to write some tests for it!
Services
You can implement any service with custim requirements by extending and implementing the AbstractService class of the corresponding OAuth version. You will need to implement the abstract methods and should be ready to go! In order to parse the token response from OAuth2 it's recommended to use TokenParserTrait provided.
HTTP Clients
You can implement any HTTP Client you desire. Just create a class that implements OAuth\Common\Http\ClientInterface. By default a CurlClient and a StreamClient are provided.
Storage
The same for storage. Just implement the OAuth\Common\Token\TokenStorageInterface and use it in your app.
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.
Included service implementations
- OAuth1
- BitBucket
- Etsy
- FitBit
- Flickr
- Scoop.it!
- Tumblr
- Yahoo
- OAuth2
- Amazon
- BitLy
- Box
- Dailymotion
- Dropbox
- FenixEdu
- Foursquare
- GitHub
- Harvest
- Heroku
- Mailchimp
- Microsoft
- PayPal
- RunKeeper
- SoundCloud
- Vkontakte
- Yammer
- more to come! (Make pull requests if you have any!)
Examples
Examples of basic usage are located in the examples/ directory.
Usage
For usage with complete auth flow, please see the examples.
Framework Integration
- Laravel 4: I have a package for the library. It has a Service Provider which makes using this package even easier!
Tests
To run the tests, you must install dependencies with composer install --dev
统计信息
- 总下载量: 48
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-08-17