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 4w 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 4% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity22

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://avatars.githubusercontent.com/u/15922843?v=4)[lulubin](/maintainers/lulubin)[@lulubin](https://github.com/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

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