PHP 7.2 oAuth 1/2 Library

Package info

github.com/Lusitanian/PHPoAuthLib

Issues

pkg:composer/lusitanian/oauth

Statistics

Installs: 23โ€‰877โ€‰940

Dependents: 137

Suggesters: 2

Stars: 1โ€‰078

v0.8.11 2018-02-14 22:37 UTC

Requires

  • php: >=5.3.0

Suggests

Provides

None

Conflicts

None

Replaces

None

MIT fc11a53db4b66da555a6a11fce294f574a8374f9

  • David Desberg <david.woop@daviddesberg.com>
  • Elliot Chance <elliotchance.woop@gmail.com>
  • Pieter Hordijk <info.woop@pieterhordijk.com>

authorizationsecurityAuthenticationoauth


README

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.

PHPoAuthLib provides oAuth support in PHP 7.2+ and is very easy to integrate with any project which requires an oAuth client.

๐Ÿ‘ Build Status
๐Ÿ‘ Code Coverage
๐Ÿ‘ Scrutinizer Quality Score
๐Ÿ‘ Latest Stable Version
๐Ÿ‘ Total Downloads

Installation

This library can be found on Packagist. The recommended way to install this is through composer.

 composer require lusitanian/oauth

Features

  • PSR-4
  • 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.

Included service implementations

  • OAuth1
    • 500px
    • BitBucket
    • Etsy
    • FitBit
    • Flickr
    • QuickBooks
    • Scoop.it!
    • Tumblr
    • Twitter
    • 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
    • Stripe
    • Ustream
    • Vimeo
    • Vkontakte
    • Xing
    • Yahoo
    • Yammer
  • more to come!

Examples

 php -S localhost:8000 -t examples

Then point your browser to:

 http://localhost:8000/

Usage

For usage with complete auth flow, please see the examples. More in-depth documentation will come with release 1.0.

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

 composer tests