PHPackages                             phpvirus/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. phpvirus/oauth

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

phpvirus/oauth
==============

PHP 5.3+ oAuth 1/2 Library

032PHP

Since Oct 27Pushed 11y ago1 watchersCompare

[ Source](https://github.com/shamimhasan/PHP-oAuth)[ Packagist](https://packagist.org/packages/phpvirus/oauth)[ RSS](/packages/phpvirus-oauth/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

PHPoAuthLib
===========

[](#phpoauthlib)

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

[![Build Status](https://camo.githubusercontent.com/5cd26e8c06a2a04375b1fc544d75ea26d8fbec9688374b3b633d073f6882ef90/68747470733a2f2f7472617669732d63692e6f72672f4c75736974616e69616e2f5048506f417574684c69622e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/Lusitanian/PHPoAuthLib)[![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/69085236b7eca24760a1af8fd986648538028a70d363f97eb48e0195b44c1778/68747470733a2f2f706f7365722e707567782e6f72672f6c75736974616e69616e2f6f617574682f762f737461626c652e706e67)](https://packagist.org/packages/lusitanian/oauth)[![Total Downloads](https://camo.githubusercontent.com/9cb1403f9b70f19707ac37c87ce74cc89c9c663b7fe0a8e74241bbb58c80e38e/68747470733a2f2f706f7365722e707567782e6f72672f6c75736974616e69616e2f6f617574682f646f776e6c6f6164732e706e67)](https://packagist.org/packages/lusitanian/oauth)

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

[](#installation)

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

Edit your `composer.json` and add:

```
{
    "require": {
        "phpvirus/oauth": "0.1.*@dev"
    }
}
```

And install dependencies:

```
$ curl -sS https://getcomposer.org/installer | php
$ php composer.phar install
```

Features
--------

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

[](#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
    - Foursquare
    - GitHub
    - Google
    - Harvest
    - Heroku
    - Instagram
    - Jawbone UP
    - LinkedIn
    - Mailchimp
    - Microsoft
    - PayPal
    - Pocket
    - Reddit
    - RunKeeper
    - SoundCloud
    - Stripe
    - Ustream
    - Vkontakte
    - Yammer
- more to come!

Examples
--------

[](#examples)

Examples of basic usage are located in the examples/ directory.

Usage
-----

[](#usage)

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

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

[](#framework-integration)

- Lithium: Sébastien Charrier has written [an adapter](https://github.com/scharrier/li3_socialauth) for the library.
- Laravel 4: Dariusz Prząda has written [a service provider](https://github.com/artdarek/oauth-4-laravel) for the library.

Extensions
----------

[](#extensions)

- Extract normalized user data from OAuth Services with the library [PHPoAuthUserData](https://github.com/Oryzone/PHPoAuthUserData) by Luciano Mammino

Tests
-----

[](#tests)

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

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/4c3f6f7063b219e5fb1fb1ee5ba7720de4d479cc08333bbecd12ee148ea9f3a5?d=identicon)[shamimhasan](/maintainers/shamimhasan)

### Embed Badge

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

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

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

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