PHPackages                             indibeast/oauth2-human - 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. indibeast/oauth2-human

ActiveLibrary

indibeast/oauth2-human
======================

Human OAuth 2.0 support for the PHP League's OAuth 2.0 Client

1921PHP

Since Feb 9Pushed 10y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Human Provider for OAuth 2.0 Client
===================================

[](#human-provider-for-oauth-20-client)

[![Build Status](https://camo.githubusercontent.com/be47f5eee30d6d74ec20d0f0079af97bc5585001045161bb9ecf3d2786fa0ca3/68747470733a2f2f7472617669732d63692e6f72672f696e646962656173742f6f61757468322d68756d616e2e737667)](https://travis-ci.org/indibeast/oauth2-human)

This package provides Human OAuth 2.0 support for the PHP League's [OAuth 2.0 Client](https://github.com/thephpleague/oauth2-client).

Usage
-----

[](#usage)

### Authorization Code Flow

[](#authorization-code-flow)

```
$provider = new \Human\OAuth2\Client\Provider\Human([
    'clientId'      => 'XXXXXXXX',
    'clientSecret'  => 'XXXXXXXX',
    'redirectUri'   => 'https://your-registered-redirect-uri/',
    'account'       => 'XXXXX'

]);

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

    $authurl = $provider->getAuthorizationUrl();
    $_SESSION['oauth2state'] = $provider->getState();
    header('Location: '.$authUrl);
    exit;

 } elseif (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth2state'])){

    unset($_SESSION['oauth2state']);
    exit('Invalid state');

 } else {

     $token = $provider->getAccessToken('authorization_code', [
                 'code' => $_GET['code']
     ]);

     try {

        $client = new Client($token);
        $user   = $client->getResourceOwner();
        echo $user->getFirstName();

     } catch (Exception $e) {

        echo "Oops!..."
     }

 }
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](https://github.com/indibeast/oauth2-human/blob/master/LICENSE) for more information.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 96.4% 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.

### Community

Maintainers

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

---

Top Contributors

[![indibeast](https://avatars.githubusercontent.com/u/5730822?v=4)](https://github.com/indibeast "indibeast (27 commits)")[![badtux](https://avatars.githubusercontent.com/u/606245?v=4)](https://github.com/badtux "badtux (1 commits)")

### Embed Badge

![Health badge](/badges/indibeast-oauth2-human/health.svg)

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

PHPackages © 2026

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