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

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

yuyangame/yii2-oauth
====================

yii2-oauth

0.1.1(10y ago)029GPL-3.0+PHP

Since Jun 16Pushed 10y ago1 watchersCompare

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

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

yii2-oauth
==========

[](#yii2-oauth)

yii2-oauth Include:QQ,Weibo,Weixin,Renren,Douban

\#Installation
--------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist yuyangame/yii2-oauth "*"

```

or add

```
"yuyangame/yii2-oauth": "*"

```

to the require section of your `composer.json` file.

\#Usage
-------

[](#usage)

Once the extension is installed, simply use it in your code by :

1.Add components configure
--------------------------

[](#1add-components-configure)

```
'components' => [
    'authClientCollection' => [
        'class' => 'yii\authclient\Collection',
        'clients' => [
            'qq' => [
                'class' => 'yuyangame\oauth\QqAuth',
                'clientId' => 'YOUR_OPEN_APPID',
                'clientSecret' => 'YOUR_OPEN_APPSCRET',
            ],
            'weibo' => [
                'class' => 'yuyangame\oauth\WeiboAuth',
                'clientId' => 'YOUR_OPEN_APPID',
                'clientSecret' => 'YOUR_OPEN_APPSCRET',
            ],
            'weixin' => [
                'class' => 'yuyangame\oauth\WeixinAuth',
                'clientId' => 'YOUR_OPEN_APPID',
                'clientSecret' => 'YOUR_OPEN_APPSCRET',
            ],
        ]
    ]
    ...
]
```

2.Add controller
----------------

[](#2add-controller)

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

    /**
     * Success Callback
     * @param QqAuth|WeiboAuth $client
     * @see http://wiki.connect.qq.com/get_user_info
     * @see http://stuff.cebe.cc/yii2docs/yii-authclient-authaction.html
     */
    public function successCallback($client) {
        $id = $client->getId(); // qq | weibo | weixin
        $attributes = $client->getUserAttributes(); // basic info
        $userInfo = $client->getUserInfo(); // user extend info
        // login or signup
    }
}
```

3.Add view
----------

[](#3add-view)

```

```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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

Every ~0 days

Total

2

Last Release

3989d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7682cc948241b86df41cf5d1881042708bec5cbb8b86858a4444d9f3bb7e81a4?d=identicon)[yuyangame](/maintainers/yuyangame)

---

Top Contributors

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

---

Tags

oauthyii2extension

### Embed Badge

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

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

###  Alternatives

[nodge/yii2-eauth

Yii2 EAuth Extension. EAuth allows to authenticate users with accounts on other websites (Google, Facebook, Twitter, etc).

19399.4k](/packages/nodge-yii2-eauth)[budyaga/yii2-users

Module for manage users and their rights with the support of registration through social services and assigned to each user more than one social service.

409.1k](/packages/budyaga-yii2-users)

PHPackages © 2026

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