PHPackages                             tunerprime/oauth2-naver - 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. tunerprime/oauth2-naver

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

tunerprime/oauth2-naver
=======================

Naver OAuth 2.0 Client

06PHP

Since Aug 29Pushed 7y ago1 watchersCompare

[ Source](https://github.com/tunerprime/oauth2-naver)[ Packagist](https://packagist.org/packages/tunerprime/oauth2-naver)[ RSS](/packages/tunerprime-oauth2-naver/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (1)Used By (0)

oauth2-naver
============

[](#oauth2-naver)

extension league/OAuth2-client version by Naver

Composer Install

```
    composer require tunerprime/oauth2-naver

```

Example Code

```
    $provider = new TunerPrime\OAuth2\Client\Provider\Naver([
        'clientId'     => '{naver-client-id}',
        'clientSecret' => '{naver-client-secret}',
        'redirectUri'  => '{your-redirect-uri}',
    ]);

    if (!empty($_GET['error'])) {

        exit('Got error: ' . htmlspecialchars($_GET['error'], ENT_QUOTES, 'UTF-8'));

    } elseif (empty($_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 {

            $ownerDetails = $provider->getResourceOwner($token);

            printf('Hello %s!', $ownerDetails->getEmail());

        } catch (Exception $e) {

            exit('Something went wrong: ' . $e->getMessage());

        }

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

        // Number of seconds until the access token will expire, and need refreshing
        echo $token->getExpires();
    }

```

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/9063204?v=4)[이우주(Woojoo Lee)](/maintainers/tunerprime)[@tunerprime](https://github.com/tunerprime)

---

Top Contributors

[![tunerprime](https://avatars.githubusercontent.com/u/9063204?v=4)](https://github.com/tunerprime "tunerprime (4 commits)")

### Embed Badge

![Health badge](/badges/tunerprime-oauth2-naver/health.svg)

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

###  Alternatives

[kartik-v/yii2-password

Useful password strength validation utilities for Yii Framework 2.0

761.2M17](/packages/kartik-v-yii2-password)

PHPackages © 2026

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