PHPackages                             datingvip/oauth2-client - 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. datingvip/oauth2-client

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

datingvip/oauth2-client
=======================

OAuth 2.0 Client Library

v0.9(5y ago)01.1kMITPHPPHP &gt;=5.3.0

Since Mar 25Pushed 5y ago11 watchersCompare

[ Source](https://github.com/DatingVIP/oauth2-client)[ Packagist](https://packagist.org/packages/datingvip/oauth2-client)[ Docs](https://github.com/datingvip/oauth2-client)[ RSS](/packages/datingvip-oauth2-client/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (5)Dependencies (3)Versions (9)Used By (0)

OAuth 2.0 Client Library
========================

[](#oauth-20-client-library)

This library makes it stupidly simple to integrate your application with OAuth 2.0 identity providers. It has built in support for:

- Facebook
- Github
- Google
- Instagram
- LinkedIn
- Microsoft

Adding support for other providers is trivial.

The library requires PHP 5.3+ and is PSR-0 compatible.

Usage
-----

[](#usage)

```
$provider = new League\OAuth2\Client\Provider\(array(
    'clientId'  =>  'XXXXXXXX',
    'clientSecret'  =>  'XXXXXXXX',
    'redirectUri'   =>  'http://your-registered-redirect-uri/'
));

if ( ! isset($_GET['code'])) {

	// If we don't have an authorization code then get one
    $provider->authorize();

} else {

    try {

    	// Try to get an access token (using the authorization code grant)
        $t = $provider->getAccessToken('authorization_code', array('code' => $_GET['code']));

        try {

        	// We got an access token, let's now get the user's details
            $userDetails = $provider->getUserDetails($t);

            foreach ($userDetails as $attribute => $value) {
                var_dump($attribute, $value) . PHP_EOL . PHP_EOL;
            }

        } catch (Exception $e) {

            // Failed to get user details

        }

    } catch (Exception $e) {

        // Failed to get access token

    }
}
```

### List of built-in identity providers

[](#list-of-built-in-identity-providers)

Provideruidnicknamenamefirst\_namelast\_nameemaillocationdescriptionimageUrlurls**Facebook**stringstringstringstringstringstringstringstringstringarray (Facebook)**Github**stringstringstringnullnullstringnullnullnullarray (Github, \[personal\])**Google**stringstringstringstringstringstringnullnullstringnull**Instagram**stringstringstringnullnullnullnullstringstringnull**LinkedIn**stringnullstringnullnullstringstringstringstringstring**Microsoft**stringnullstringstringstringstringnullnullstringstring**Notes**: Providers which return URLs sometimes include additional URLs if the user has provided them. These have been wrapped in \[\]

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 57.7% 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 ~442 days

Recently: every ~408 days

Total

7

Last Release

2138d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b3d0432439843a2a063fec06efcf774d2193469dd51d72cfbb6457f6301004cf?d=identicon)[kornrunner](/maintainers/kornrunner)

---

Top Contributors

[![alexbilbie](https://avatars.githubusercontent.com/u/77991?v=4)](https://github.com/alexbilbie "alexbilbie (45 commits)")[![bencorlett](https://avatars.githubusercontent.com/u/181919?v=4)](https://github.com/bencorlett "bencorlett (9 commits)")[![kornrunner](https://avatars.githubusercontent.com/u/725986?v=4)](https://github.com/kornrunner "kornrunner (8 commits)")[![msurguy](https://avatars.githubusercontent.com/u/585833?v=4)](https://github.com/msurguy "msurguy (6 commits)")[![perfectlounge](https://avatars.githubusercontent.com/u/4036172?v=4)](https://github.com/perfectlounge "perfectlounge (4 commits)")[![dhrrgn](https://avatars.githubusercontent.com/u/149921?v=4)](https://github.com/dhrrgn "dhrrgn (3 commits)")[![bitinn](https://avatars.githubusercontent.com/u/1484279?v=4)](https://github.com/bitinn "bitinn (1 commits)")[![tfountain](https://avatars.githubusercontent.com/u/387569?v=4)](https://github.com/tfountain "tfountain (1 commits)")[![tomsobpl](https://avatars.githubusercontent.com/u/124267?v=4)](https://github.com/tomsobpl "tomsobpl (1 commits)")

---

Tags

AuthenticationSSOidentityoauthoauth2authorizationidpsingle sign on

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/datingvip-oauth2-client/health.svg)

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

###  Alternatives

[league/oauth2-client

OAuth 2.0 Client Library

3.8k118.6M1.2k](/packages/league-oauth2-client)

PHPackages © 2026

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