PHPackages                             brlab-inc/oauth2-line - 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. brlab-inc/oauth2-line

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

brlab-inc/oauth2-line
=====================

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

1.0(5y ago)019MITPHP

Since Apr 25Pushed 5y agoCompare

[ Source](https://github.com/brlab-inc/oauth2-line)[ Packagist](https://packagist.org/packages/brlab-inc/oauth2-line)[ RSS](/packages/brlab-inc-oauth2-line/feed)WikiDiscussions main Synced yesterday

READMEChangelogDependencies (3)Versions (2)Used By (0)

LINE Provider for OAuth 2.0 Client
==================================

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

[![License](https://camo.githubusercontent.com/61a777322f593e21e4d6b9d4fe65ffc48688a66a6a5ef14a2cc08addf13376a4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6c65616775652f6f61757468322d676f6f676c652e737667)](https://github.com/tavii/oauth2-yconnect/blob/master/LICENSE)

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

Installation
============

[](#installation)

To install, use composer.

```
$ composer require brlab-inc/oauth2-line

```

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

```
$provider = new BRlab\OAuth2\Client\Provider\Line([
    'clientId'          => '{client-id}',
    'clientSecret'      => '{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->getNamex());

    } 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();
}

```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

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

1843d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/36683806?v=4)[YAMATO Takeshi](/maintainers/yamato-brl)[@yamato-brl](https://github.com/yamato-brl)

---

Top Contributors

[![yamato-brl](https://avatars.githubusercontent.com/u/36683806?v=4)](https://github.com/yamato-brl "yamato-brl (2 commits)")

---

Tags

clientoauthoauth2authorizationauthorisationline

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/brlab-inc-oauth2-line/health.svg)

```
[![Health](https://phpackages.com/badges/brlab-inc-oauth2-line/health.svg)](https://phpackages.com/packages/brlab-inc-oauth2-line)
```

###  Alternatives

[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)
