PHPackages                             dscafati/laravel-oauth2 - 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. dscafati/laravel-oauth2

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

dscafati/laravel-oauth2
=======================

Authorize users in your application with multiple OAuth 2.0 providers.

0.4.14(10y ago)09PHPCI passing

Since May 23Pushed 10y ago1 watchersCompare

[ Source](https://github.com/dscafati/laravel-oauth2)[ Packagist](https://packagist.org/packages/dscafati/laravel-oauth2)[ Docs](https://github.com/dscafati/laravel-oauth2)[ RSS](/packages/dscafati-laravel-oauth2/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)Dependencies (1)Versions (33)Used By (0)

Laravel OAuth 2.0
=================

[](#laravel-oauth-20)

**This is a port to Laravel 4 of Talor Otwell's Laravel-oAuth2 bundle. Which he based on the CodeIgniter OAuth2 Spark maintained by Phil Sturgeon**

Authorize users with your application in a driver-base fashion meaning one implementation works for multiple OAuth 2 providers. This is only to authenticate onto OAuth2 providers and not to build an OAuth2 service.

Note that this package *ONLY* provides the authorization mechanism. There's an example controller below.

Installation via Composer
-------------------------

[](#installation-via-composer)

Add this to you composer.json file, in the require object;

```
"SimpleUsername/laravel-oauth2": "0.4.*"

```

After that, run composer install to install Laravel OAuth 2.0.

Currently Supported
-------------------

[](#currently-supported)

- Facebook
- Foursquare
- GitHub
- Google
- iHealth
- Jawbone
- Mailchimp
- Misfit
- Moves
- Runkeeper
- Strava
- Uber
- Under Armour
- Windows Live
- YouTube

Usage Example
-------------

[](#usage-example)

```
use OAuth2\OAuth2;
use OAuth2\Token_Access;
use OAuth2\Exception as OAuth2_Exception;

public function action_session($provider)
{
	$provider = OAuth2::provider($provider, array(
		'id' => 'your-client-id',
		'secret' => 'your-client-secret',
	));

	if ( ! isset($_GET['code']))
	{
		// By sending no options it'll come back here
		return $provider->authorize();
	}
	else
	{
		// Howzit?
		try
		{
			$params = $provider->access($_GET['code']);

        		$token = new Token_Access(array(
        			'access_token' => $params->access_token
        		));
        		$user = $provider->get_user_info($token);

			// Here you should use this information to A) look for a user B) help a new user sign up with existing data.
			// If you store it all in a cookie and redirect to a registration page this is crazy-simple.
			echo "";
			var_dump($user);
		}

		catch (OAuth2_Exception $e)
		{
			show_error('That didnt work: '.$e);
		}
	}
}
```

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor5

5 contributors hold 50%+ of commits

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 ~31 days

Recently: every ~84 days

Total

32

Last Release

3812d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3ddf343818c55d48719c67ccf3e8db07cca87c6ae1289665991b2b87cd1ded1d?d=identicon)[dscafati](/maintainers/dscafati)

---

Top Contributors

[![taylorotwell](https://avatars.githubusercontent.com/u/463230?v=4)](https://github.com/taylorotwell "taylorotwell (11 commits)")[![wyred](https://avatars.githubusercontent.com/u/432325?v=4)](https://github.com/wyred "wyred (6 commits)")[![andrew-s](https://avatars.githubusercontent.com/u/479306?v=4)](https://github.com/andrew-s "andrew-s (4 commits)")[![marekmurawski](https://avatars.githubusercontent.com/u/546078?v=4)](https://github.com/marekmurawski "marekmurawski (4 commits)")[![stevebauman](https://avatars.githubusercontent.com/u/6421846?v=4)](https://github.com/stevebauman "stevebauman (3 commits)")[![dimsav](https://avatars.githubusercontent.com/u/1785686?v=4)](https://github.com/dimsav "dimsav (2 commits)")[![ericlbarnes](https://avatars.githubusercontent.com/u/116662?v=4)](https://github.com/ericlbarnes "ericlbarnes (2 commits)")[![crodjer](https://avatars.githubusercontent.com/u/343499?v=4)](https://github.com/crodjer "crodjer (2 commits)")[![jonasvanschoote](https://avatars.githubusercontent.com/u/1032147?v=4)](https://github.com/jonasvanschoote "jonasvanschoote (2 commits)")[![bramdevries](https://avatars.githubusercontent.com/u/1002245?v=4)](https://github.com/bramdevries "bramdevries (2 commits)")[![MathijsJH](https://avatars.githubusercontent.com/u/156071?v=4)](https://github.com/MathijsJH "MathijsJH (2 commits)")[![prateem](https://avatars.githubusercontent.com/u/5553562?v=4)](https://github.com/prateem "prateem (2 commits)")[![caseyamcl](https://avatars.githubusercontent.com/u/53035?v=4)](https://github.com/caseyamcl "caseyamcl (2 commits)")[![vlakarados](https://avatars.githubusercontent.com/u/386678?v=4)](https://github.com/vlakarados "vlakarados (2 commits)")[![hannesvdvreken](https://avatars.githubusercontent.com/u/1410358?v=4)](https://github.com/hannesvdvreken "hannesvdvreken (1 commits)")[![headcastlab](https://avatars.githubusercontent.com/u/8221734?v=4)](https://github.com/headcastlab "headcastlab (1 commits)")[![jhastingsiii](https://avatars.githubusercontent.com/u/13514539?v=4)](https://github.com/jhastingsiii "jhastingsiii (1 commits)")[![joelstahre](https://avatars.githubusercontent.com/u/2317917?v=4)](https://github.com/joelstahre "joelstahre (1 commits)")[![dscafati](https://avatars.githubusercontent.com/u/1949710?v=4)](https://github.com/dscafati "dscafati (1 commits)")[![davekelly](https://avatars.githubusercontent.com/u/109402?v=4)](https://github.com/davekelly "davekelly (1 commits)")

---

Tags

laraveloauth2

### Embed Badge

![Health badge](/badges/dscafati-laravel-oauth2/health.svg)

```
[![Health](https://phpackages.com/badges/dscafati-laravel-oauth2/health.svg)](https://phpackages.com/packages/dscafati-laravel-oauth2)
```

###  Alternatives

[jeremy379/laravel-openid-connect

OpenID Connect support to the PHP League's OAuth2 Server. Compatible with Laravel Passport.

59403.6k8](/packages/jeremy379-laravel-openid-connect)[maicol07/laravel-oidc-client

OpenID Connect Client for Laravel

281.3k](/packages/maicol07-laravel-oidc-client)[aurorawebsoftware/aauth

Laravel Aauth

411.9k1](/packages/aurorawebsoftware-aauth)

PHPackages © 2026

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