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

Abandoned → [laravel/socialite](/?search=laravel%2Fsocialite)ArchivedLibrary[Authentication &amp; Authorization](/categories/authentication)

madewithlove/laravel-oauth2
===========================

Authorize users in your application with multiple OAuth 2.0 providers.

0.4.13(11y ago)9544.3k↓40.6%34[4 PRs](https://github.com/madewithlove/laravel-oauth2/pulls)PHP

Since May 23Pushed 5y ago24 watchersCompare

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

READMEChangelog (2)Dependencies (1)Versions (32)Used By (0)

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

[](#laravel-oauth-20)

**⚠️ This package is abandoned**

Please use [Laravel Socialite](https://laravel.com/docs/8.x/socialite) for OAuth logins instead of this outdated package.

**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;

```
"madewithlove/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

42

—

FairBetter than 90% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity45

Moderate usage in the ecosystem

Community30

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

Recently: every ~29 days

Total

31

Last Release

4069d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8cb417d1d61b7c3b4e69ff7ea9328f7d4f7e0af38b4fd92d82167a9904e93ac5?d=identicon)[andreascreten](/maintainers/andreascreten)

![](https://www.gravatar.com/avatar/df052a58ecfa5a07fd2b4cb12bb128ab28ff4b8e82fb0831eab81623b898ddb4?d=identicon)[madewithlove-machine-user](/maintainers/madewithlove-machine-user)

---

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)")[![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)")[![WouterSioen](https://avatars.githubusercontent.com/u/1398405?v=4)](https://github.com/WouterSioen "WouterSioen (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)")[![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)")[![hannesvdvreken](https://avatars.githubusercontent.com/u/1410358?v=4)](https://github.com/hannesvdvreken "hannesvdvreken (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/madewithlove-laravel-oauth2/health.svg)

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

###  Alternatives

[jeremy379/laravel-openid-connect

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

55342.3k2](/packages/jeremy379-laravel-openid-connect)[webfox/laravel-xero-oauth2

A Laravel integration for Xero using the Oauth 2.0 spec

58452.0k2](/packages/webfox-laravel-xero-oauth2)[maicol07/laravel-oidc-client

OpenID Connect Client for Laravel

251.1k](/packages/maicol07-laravel-oidc-client)

PHPackages © 2026

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