PHPackages                             vasilvestre/oauth2-brimetv - 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. vasilvestre/oauth2-brimetv

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

vasilvestre/oauth2-brimetv
==========================

Brime OAuth 2.0 Client Provider

0.1.0(4y ago)071MITPHPPHP ^7.4 || ^8.0

Since Sep 9Pushed 4y ago1 watchersCompare

[ Source](https://github.com/vasilvestre/oauth2-brimetv)[ Packagist](https://packagist.org/packages/vasilvestre/oauth2-brimetv)[ RSS](/packages/vasilvestre-oauth2-brimetv/feed)WikiDiscussions main Synced 2d ago

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

Brime Provider for OAuth 2.0 Client
===================================

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

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![codecov](https://camo.githubusercontent.com/7a7816063b93ed1e53542c978d35f871885b2b6f8e30123e39a3b9977cb31bed/68747470733a2f2f636f6465636f762e696f2f67682f766173696c7665737472652f6f61757468322d6272696d6574762f6272616e63682f6d61696e2f67726170682f62616467652e7376673f746f6b656e3d7341423475634e677031)](https://codecov.io/gh/vasilvestre/oauth2-brimetv)

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

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

[](#installation)

To install, use composer:

```
composer require vasilvestre/oauth2-brimetv

```

Usage
-----

[](#usage)

Usage is the same as The League's OAuth client, using `\League\OAuth2\Client\Provider\Github` as the provider.

### Authorization Code Flow

[](#authorization-code-flow)

```
$provider = new League\OAuth2\Client\Provider\Brime([
    'clientId'          => '{brime-client-id}',
    'clientSecret'      => '{brime-client-secret}',
    'redirectUri'       => 'https://example.com/callback-url',
]);

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

    // If we don't have an authorization code then get one
    $authUrl = $provider->getAuthorizationUrl();
    $_SESSION['oauth2state'] = $provider->getState();
    header('Location: '.$authUrl);
    exit;

// Check given state against previously stored one to mitigate CSRF attack
} elseif (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth2state'])) {

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

} else {

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

    // Optional: Now you have a token you can look up a users profile data
    try {

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

        // Use these details to create a new profile
        printf('Hello %s!', $user->getNickname());

    } catch (Exception $e) {

        // Failed to get user details
        exit('Oh dear...');
    }

    // Use this to interact with an API on the users behalf
    echo $token->getToken();
}
```

Testing
-------

[](#testing)

Not yet

```
$ ./vendor/bin/phpunit
```

Credits
-------

[](#credits)

- [Valentin Silvestre](https://github.com/vasilvestre)
- [Nicolas Mylle](https://github.com/artandor)

License
-------

[](#license)

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

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

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

Unknown

Total

1

Last Release

1706d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4409af876442306929e286aba346113202328e1668a2af73acb2aa54d20f8088?d=identicon)[vasilvestre](/maintainers/vasilvestre)

---

Top Contributors

[![vasilvestre](https://avatars.githubusercontent.com/u/17164385?v=4)](https://github.com/vasilvestre "vasilvestre (8 commits)")[![artandor](https://avatars.githubusercontent.com/u/22364556?v=4)](https://github.com/artandor "artandor (3 commits)")

---

Tags

clientoauthoauth2brime

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/vasilvestre-oauth2-brimetv/health.svg)

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

###  Alternatives

[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[thenetworg/oauth2-azure

Azure Active Directory OAuth 2.0 Client Provider for The PHP League OAuth2-Client

2509.6M48](/packages/thenetworg-oauth2-azure)[stevenmaguire/oauth2-keycloak

Keycloak OAuth 2.0 Client Provider for The PHP League OAuth2-Client

2275.9M27](/packages/stevenmaguire-oauth2-keycloak)[patrickbussmann/oauth2-apple

Sign in with Apple OAuth 2.0 Client Provider for The PHP League OAuth2-Client

1132.5M6](/packages/patrickbussmann-oauth2-apple)[mollie/oauth2-mollie-php

Mollie Provider for OAuth 2.0 Client

251.7M1](/packages/mollie-oauth2-mollie-php)[omines/oauth2-gitlab

GitLab OAuth 2.0 Client Provider for The PHP League OAuth2-Client

36721.5k13](/packages/omines-oauth2-gitlab)

PHPackages © 2026

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