PHPackages                             pasadinhas/oauth - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. pasadinhas/oauth

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

pasadinhas/oauth
================

PHP 5.4+ OAuth (1 and 2) client library

1.0.2(11y ago)0481MITPHPPHP &gt;=5.4.0

Since Feb 12Pushed 11y ago1 watchersCompare

[ Source](https://github.com/pasadinhas/php-oauth-lib)[ Packagist](https://packagist.org/packages/pasadinhas/oauth)[ RSS](/packages/pasadinhas-oauth/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (3)Versions (17)Used By (1)

php-oauth-lib
=============

[](#php-oauth-lib)

php-oauth-lib provides OAuth support in PHP 5.4+ and is very easy to integrate with any project which requires an OAuth client.

[![Build Status](https://camo.githubusercontent.com/f9b7aaf51747623684fd5da380eddead7e51b9d0b7a481db07adcf3bd52bf5ac/68747470733a2f2f7472617669732d63692e6f72672f7061736164696e6861732f7068702d6f617574682d6c69622e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/pasadinhas/php-oauth-lib)[![Code Coverage](https://camo.githubusercontent.com/f221fc8247e85ba89e3bd26c16bbd0f1dd0a2c44c06434f5e840aad589a9a99f/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4c75736974616e69616e2f5048506f417574684c69622f6261646765732f636f7665726167652e706e673f733d61306131356265626664613439653739663963653238396230306336646665626431386663393865)](https://scrutinizer-ci.com/g/Lusitanian/PHPoAuthLib/)[![Scrutinizer Quality Score](https://camo.githubusercontent.com/5827f312f7bd7f3dc188ad895ae4e793a705cfbdfc1ebf21beb5607efa6ee452/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4c75736974616e69616e2f5048506f417574684c69622f6261646765732f7175616c6974792d73636f72652e706e673f733d63353937366432666566636562353031663064383836633161356266303837653639623434353333)](https://scrutinizer-ci.com/g/Lusitanian/PHPoAuthLib/)[![Latest Stable Version](https://camo.githubusercontent.com/c3e9ad1b505dfe64ab85aaa7bc795176781b373b3af392232f2a196e00964f5d/68747470733a2f2f706f7365722e707567782e6f72672f7061736164696e6861732f6f617574682f762f737461626c652e706e67)](https://packagist.org/packages/pasadinhas/oauth)[![Total Downloads](https://camo.githubusercontent.com/6ad5c8d75e3122ba72764d8386d15da9dd5bf66012d69081d289efd5cb9847ba/68747470733a2f2f706f7365722e707567782e6f72672f7061736164696e6861732f6f617574682f646f776e6c6f6164732e706e67)](https://packagist.org/packages/pasadinhas/oauth)

Installation
------------

[](#installation)

This library can be found on [Packagist](https://packagist.org/packages/pasadinhas/oauth). The recommended way to install this is through [composer](http://getcomposer.org).

Edit your `composer.json` and add:

```
{
    "require": {
        "pasadinhas/oauth": "~1.0.0"
    }
}
```

And then update your dependencies with:

```
$ composer update
```

Extend this package
-------------------

[](#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

[](#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

[](#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

[](#storage)

The same for storage. Just implement the `OAuth\Common\Token\TokenStorageInterface` and use it in your app.

Service support
---------------

[](#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
--------------------------------

[](#included-service-implementations)

- OAuth1
    - BitBucket
    - Etsy
    - FitBit
    - Flickr
    - Scoop.it!
    - Tumblr
    - Twitter
    - Xing
    - Yahoo
- OAuth2
    - Amazon
    - BitLy
    - Box
    - Dailymotion
    - Dropbox
    - Facebook
    - FenixEdu
    - Foursquare
    - GitHub
    - Google
    - Harvest
    - Heroku
    - Instagram
    - LinkedIn
    - Mailchimp
    - Microsoft
    - PayPal
    - Pocket
    - Reddit
    - RunKeeper
    - SoundCloud
    - Vkontakte
    - Yammer
- more to come! (Make pull requests if you have any!)

Examples
--------

[](#examples)

Examples of basic usage are located in the [examples/](https://github.com/pasadinhas/oauth/tree/master/examples/) directory.

Usage
-----

[](#usage)

For usage with complete auth flow, please see the [examples](https://github.com/pasadinhas/oauth/tree/master/examples/).

Framework Integration
---------------------

[](#framework-integration)

- Laravel 4: I have a [package](https://github.com/pasadinhas/laravel-oauth) for the library. It has a Service Provider which makes using this package even easier!

Tests
-----

[](#tests)

To run the tests, you must install dependencies with `composer install --dev`

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 53% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~36 days

Recently: every ~59 days

Total

16

Last Release

4290d ago

Major Versions

v0.1.4 → 1.0.x-dev2013-06-19

v0.3.0 → 1.0.02014-08-16

PHP version history (2 changes)v0.1.0PHP &gt;=5.4.0

1.0.x-devPHP &gt;=5.3.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/91f7fe11972214893f1ac7bfe987021e018f9216d44af4381032682ea1d28478?d=identicon)[pasadinhas](/maintainers/pasadinhas)

---

Top Contributors

[![PeeHaa](https://avatars.githubusercontent.com/u/1330296?v=4)](https://github.com/PeeHaa "PeeHaa (174 commits)")[![hannesvdvreken](https://avatars.githubusercontent.com/u/1410358?v=4)](https://github.com/hannesvdvreken "hannesvdvreken (20 commits)")[![flavioheleno](https://avatars.githubusercontent.com/u/471860?v=4)](https://github.com/flavioheleno "flavioheleno (14 commits)")[![borfast](https://avatars.githubusercontent.com/u/4837?v=4)](https://github.com/borfast "borfast (13 commits)")[![pasadinhas](https://avatars.githubusercontent.com/u/4405254?v=4)](https://github.com/pasadinhas "pasadinhas (13 commits)")[![elicwhite](https://avatars.githubusercontent.com/u/249164?v=4)](https://github.com/elicwhite "elicwhite (10 commits)")[![thomaswelton](https://avatars.githubusercontent.com/u/678372?v=4)](https://github.com/thomaswelton "thomaswelton (8 commits)")[![bencorlett](https://avatars.githubusercontent.com/u/181919?v=4)](https://github.com/bencorlett "bencorlett (7 commits)")[![toin0u](https://avatars.githubusercontent.com/u/672421?v=4)](https://github.com/toin0u "toin0u (7 commits)")[![mouhamed](https://avatars.githubusercontent.com/u/3195102?v=4)](https://github.com/mouhamed "mouhamed (6 commits)")[![igorw](https://avatars.githubusercontent.com/u/88061?v=4)](https://github.com/igorw "igorw (6 commits)")[![connyay](https://avatars.githubusercontent.com/u/597300?v=4)](https://github.com/connyay "connyay (5 commits)")[![gigablah](https://avatars.githubusercontent.com/u/471275?v=4)](https://github.com/gigablah "gigablah (5 commits)")[![zackkatz](https://avatars.githubusercontent.com/u/870979?v=4)](https://github.com/zackkatz "zackkatz (3 commits)")[![cmfcmf](https://avatars.githubusercontent.com/u/2145092?v=4)](https://github.com/cmfcmf "cmfcmf (3 commits)")[![hakre](https://avatars.githubusercontent.com/u/378849?v=4)](https://github.com/hakre "hakre (3 commits)")[![inakiabt](https://avatars.githubusercontent.com/u/606852?v=4)](https://github.com/inakiabt "inakiabt (3 commits)")[![lmammino](https://avatars.githubusercontent.com/u/205629?v=4)](https://github.com/lmammino "lmammino (3 commits)")[![oblogic7](https://avatars.githubusercontent.com/u/453840?v=4)](https://github.com/oblogic7 "oblogic7 (3 commits)")[![robbanl](https://avatars.githubusercontent.com/u/922250?v=4)](https://github.com/robbanl "robbanl (3 commits)")

---

Tags

securityAuthenticationoauthauthorization

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/pasadinhas-oauth/health.svg)

```
[![Health](https://phpackages.com/badges/pasadinhas-oauth/health.svg)](https://phpackages.com/packages/pasadinhas-oauth)
```

###  Alternatives

[lusitanian/oauth

PHP 7.2 oAuth 1/2 Library

1.1k23.2M121](/packages/lusitanian-oauth)[oryzone/oauth-user-data

Extension library for Lusitanian/PHPoAuthLib to extract user profile data from various oAuth providers

4558.6k](/packages/oryzone-oauth-user-data)[and/oauth

Simple and amazing OAuth library with many providers. Just try it out!

4645.2k2](/packages/and-oauth)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
