PHPackages                             tlikai/oauth2china - 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. tlikai/oauth2china

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

tlikai/oauth2china
==================

Authorize users in you application with oauth 2.0 providers

v1.0(12y ago)81251[1 issues](https://github.com/tlikai/OAuth2China/issues)New BSDPHPPHP &gt;=5.0

Since May 15Pushed 10y ago2 watchersCompare

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

READMEChangelogDependenciesVersions (2)Used By (0)

OAuth2China
===========

[](#oauth2china)

OAuth2China 是一个支持国内多家社交平台OAuth授权的扩展，需要PHP CURL扩展支持

OAuth2China支持下列平台
-----------------

[](#oauth2china支持下列平台)

- 新浪微博
- QQ空间
- 豆瓣
- 人人

使用方法
----

[](#使用方法)

```
public function actionAuth($provider)
{
    // 导入OAuth2China
    Yii::import('ext.yii-oauth2china.OAuth2China');

    // 配置各平台参数
    $providers = array(
        'weibo' => array(
            'id' => 'App key',
            'secret' => 'App secret',
        ),
        'qq' => array(
            'id' => 'APP ID',
            'secret' => 'APP KEY',
        ),
        'douban' => array(
            'id' => 'API Key',
            'secret' => 'Secret',
        ),
        'renren' => array(
            'id' => 'API key',
            'secret' => 'Secret key',
        ),
    );

    $OAuth2China = new OAuth2China($providers);

    $provider = $OAuth2China->getProvider('qq'); // getProvider方法的参数对应$providers配置中的key

    if(!isset($_GET['code']))
    {
        // 跳转到授权页面
        $provider->redirect();
    }
    else
    {
        // 获取access token
        $token = $provider->getAccessToken($_GET['code']);
        var_dump($token);
    }
}

```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

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

4743d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/95a7e28bfad31da4aecd922e5a056f33edda44817de7137e5c8fbc1634080349?d=identicon)[likai](/maintainers/likai)

---

Top Contributors

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

---

Tags

oauthyii

### Embed Badge

![Health badge](/badges/tlikai-oauth2china/health.svg)

```
[![Health](https://phpackages.com/badges/tlikai-oauth2china/health.svg)](https://phpackages.com/packages/tlikai-oauth2china)
```

###  Alternatives

[league/oauth2-server

A lightweight and powerful OAuth 2.0 authorization and resource server library with support for all the core specification grants. This library will allow you to secure your API with OAuth and allow your applications users to approve apps that want to access their data from your API.

6.6k136.0M248](/packages/league-oauth2-server)[league/oauth2-client

OAuth 2.0 Client Library

3.8k118.6M1.2k](/packages/league-oauth2-client)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[knpuniversity/oauth2-client-bundle

Integration with league/oauth2-client to provide services

83416.7M61](/packages/knpuniversity-oauth2-client-bundle)[socialiteproviders/manager

Easily add new or override built-in providers in Laravel Socialite.

42442.0M544](/packages/socialiteproviders-manager)[league/oauth2-google

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

41721.2M118](/packages/league-oauth2-google)

PHPackages © 2026

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