PHPackages                             lulubin/yii2-oauth - 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. lulubin/yii2-oauth

ActiveYii2-extension[Authentication &amp; Authorization](/categories/authentication)

lulubin/yii2-oauth
==================

An yii2 extension for oauth

0330PHP

Since Jul 25Pushed 2y ago1 watchersCompare

[ Source](https://github.com/lulubin/yii2-oauth)[ Packagist](https://packagist.org/packages/lulubin/yii2-oauth)[ RSS](/packages/lulubin-yii2-oauth/feed)WikiDiscussions main Synced 2mo ago

READMEChangelog (1)DependenciesVersions (1)Used By (0)

1.Install
---------

[](#1install)

composer require --prefer-dist lulubin/yii2-oauth "dev-master"

2.Config
--------

[](#2config)

```
'components' => [
    'authClientCollection' => [
        'class' => 'yii\authclient\Collection',
        'clients' => [
            'qq' => [
                'class' => 'lulubin\oauth\Qq',
                'clientId' => '***',
                'clientSecret' => '***',
            ],
            'weixin' => [
                'class' => 'lulubin\oauth\Weixin',
                'clientId' => '***',
                'clientSecret' => '***',
            ],
            'weibo' => [
                'class' => 'lulubin\oauth\Weibo',
                'clientId' => '***',
                'clientSecret' => '***',
            ],
            'github' => [
                'class' => 'yii\authclient\clients\GitHub',
                'clientId' => '***',
                'clientSecret' => '***,
            ],
        ]
    ]
]
```

3.Usage
-------

[](#3usage)

### Controller

[](#controller)

```
class SiteController extends Controller
{
    public function actions()
    {
        return [
            'auth' => [
                'class' => 'yii\authclient\AuthAction',
                'successCallback' => [$this, 'successCallback'],
            ],
        ];
    }

    public function successCallback($client)
    {
        $id = $client->getId();
        $attributes = $client->getUserAttributes();
        var_dump($id, $attributes);
    }
}
```

### View

[](#view)

```

```

4.申请上述第三方的 APP ID 和 APP KEY
---------------------------

[](#4申请上述第三方的-app-id-和-app-key)

（1）QQ互联：

（2）微信开放 平台：

（3）新浪微博开放平台：

（4）Github Developer applications：

QQ和微博的申请比较麻烦，时间久网站 需要备案；

Github的申请则十分迅速，建议先申请这个测试。

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity21

Early-stage or recently created project

 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://www.gravatar.com/avatar/38f0f8abc454bb4b20dac2a2221c0bbe12e8c39dde9a5312874b297954fbc744?d=identicon)[lulubin](/maintainers/lulubin)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/lulubin-yii2-oauth/health.svg)

```
[![Health](https://phpackages.com/badges/lulubin-yii2-oauth/health.svg)](https://phpackages.com/packages/lulubin-yii2-oauth)
```

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

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

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

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