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

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

jenssegers/oauth
================

Laravel OAuth library based on Lusitanian/PHPoAuthLib

v2.0.2(9y ago)6718.5k11[8 issues](https://github.com/jenssegers/laravel-oauth/issues)MITPHPPHP &gt;=5.4

Since Apr 24Pushed 9y ago4 watchersCompare

[ Source](https://github.com/jenssegers/laravel-oauth)[ Packagist](https://packagist.org/packages/jenssegers/oauth)[ Docs](https://github.com/jenssegers/laravel-oauth)[ RSS](/packages/jenssegers-oauth/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (6)Versions (11)Used By (0)

Laravel OAuth
=============

[](#laravel-oauth)

[![Build Status](https://camo.githubusercontent.com/5681e518a15ae6deebdf7957329d9b86740efdb2c87454afa1e8518272c65f09/687474703a2f2f696d672e736869656c64732e696f2f7472617669732f6a656e737365676572732f6c61726176656c2d6f617574682e737667)](https://travis-ci.org/jenssegers/laravel-oauth) [![Coverage Status](https://camo.githubusercontent.com/75e41be233ed040f9b8553e2541e203101ba29209751eb36c988bb8622828754/687474703a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f6a656e737365676572732f6c61726176656c2d6f617574682e737667)](https://coveralls.io/r/jenssegers/laravel-oauth)

A Laravel OAuth 1 and 2 library, using [PHPoAuthLib](https://github.com/Lusitanian/PHPoAuthLib). This library shares the Laravel session to store tokens and supports the services configuration file that was introduced in Laravel.

Supported services
------------------

[](#supported-services)

- 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
    - Spotify
    - Ustream
    - Vkontakte
    - Yammer

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

[](#installation)

Install using composer:

```
composer require jenssegers/oauth

```

Add the service provider in `app/config/app.php`:

```
'Jenssegers\OAuth\OAuthServiceProvider',

```

Add the OAuth alias to `app/config/app.php`:

```
'OAuth'            => 'Jenssegers\OAuth\Facades\OAuth',

```

Configuration
-------------

[](#configuration)

This package supports configuration through the services configuration file located in `config/services.php`:

```
'facebook' => [
    'client_id'     => 'your-client-id',
    'client_secret' => 'your-client-secret',
    'scope'         => [],
]

```

Usage
-----

[](#usage)

Once you have added your credentials, you can create PHPoAuthLib service objects like this:

```
$oauth = OAuth::consumer('facebook');

```

To override the default redirect url, or scope use:

```
$oauth = OAuth::consumer('facebook', URL::to('url'), ['email', 'publish_actions']);

```

Once you have the service object, you can use it to interact with the service's API. For more information check out [PHPoAuthLib](https://github.com/Lusitanian/PHPoAuthLib).

Example
-------

[](#example)

Example usage for the Facebook API.

```
$facebook = OAuth::consumer('facebook');

// Response from Facebook
if ($code = Input::get('code'))
{
    $token = $facebook->requestAccessToken($code);

    $result = json_decode($facebook->request('/me'), true);

    echo 'Your unique facebook user id is: ' . $result['id'] . ' and your name is ' . $result['name'];
}

// Redirect to login
else
{
    return Redirect::away((string) $facebook->getAuthorizationUri());
}

```

For more examples check out [PHPoAuthLib](https://github.com/Lusitanian/PHPoAuthLib/tree/master/examples).

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 94.9% 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 ~125 days

Recently: every ~203 days

Total

9

Last Release

3400d ago

Major Versions

v1.1.2 → v2.0.0-beta2015-02-14

PHP version history (2 changes)v1.0.0PHP &gt;=5.3

v1.1.0PHP &gt;=5.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/91980fbd02c3e65e0b2ec1c65e4ca0131f1bbc3929a0a11a7f4f12db5f2036e3?d=identicon)[jenssegers](/maintainers/jenssegers)

---

Top Contributors

[![jenssegers](https://avatars.githubusercontent.com/u/194377?v=4)](https://github.com/jenssegers "jenssegers (37 commits)")[![headersalreadysent](https://avatars.githubusercontent.com/u/389757?v=4)](https://github.com/headersalreadysent "headersalreadysent (1 commits)")[![samuelcasas](https://avatars.githubusercontent.com/u/1270065?v=4)](https://github.com/samuelcasas "samuelcasas (1 commits)")

---

Tags

laraveloauth

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[socialiteproviders/manager

Easily add new or override built-in providers in Laravel Socialite.

42542.0M544](/packages/socialiteproviders-manager)[kovah/laravel-socialite-oidc

OpenID Connect OAuth2 Provider for Laravel Socialite

2073.7k](/packages/kovah-laravel-socialite-oidc)[mmanos/laravel-social

A social login package for Laravel 4.

556.8k](/packages/mmanos-laravel-social)[pitchanon/facebook-connect

A Laravel package for connecting to the Meta (Facebook) Graph API.

254.3k1](/packages/pitchanon-facebook-connect)

PHPackages © 2026

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