PHPackages                             leo0o/sns-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. leo0o/sns-oauth

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

leo0o/sns-oauth
===============

another php lib for sns oauth2.0

1.0.8(5y ago)173MITPHP

Since Sep 19Pushed 5y ago1 watchersCompare

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

READMEChangelog (9)DependenciesVersions (9)Used By (0)

sns-oauth
=========

[](#sns-oauth)

oauth2.0 通过回调返回的code获取用户相关信息，支持平台：
----------------------------------

[](#oauth20-通过回调返回的code获取用户相关信息支持平台)

- 微博
- 微信
- qq

安装
--

[](#安装)

`php composer.phar require leo0o/sns-oauth`**or**`composer require leo0o/sns-oauth`

使用
--

[](#使用)

```
try {
    $wechat = new \oauth\OAuth('平台类型, 如：\SNSOAuth\Common\Platform::SINA_WEIBO' , [
            'appKey'=>'你的appkey',
            'appSecret'=>'你的appsecret',
            'redirectUrl'=>'回调地址，必传'
            ]);
    $userinfo = $wechat->Authrize('回调带回的code');
} catch (OAuthException $e) {
    var_dump(echo $e->getMessage());
}
```

#### 返回格式：

[](#返回格式)

```
[
    'nickname'      =>  '',
    'openid'        =>  '',
    'sex'           =>  '',   //0未知, 1男, 2女
    'headimgurl'    =>  '',
    'unionid'       =>  ''
]
```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity67

Established project with proven stability

 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 ~115 days

Recently: every ~201 days

Total

8

Last Release

2037d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/29d0bec0ca0432259d810dbd50e0d8dc870bab7a5c0e99f15ff014b6e3dfe6ee?d=identicon)[leo0o](/maintainers/leo0o)

---

Top Contributors

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

---

Tags

loginoauth2qqsnsthirdpartyweiboweixin

### Embed Badge

![Health badge](/badges/leo0o-sns-oauth/health.svg)

```
[![Health](https://phpackages.com/badges/leo0o-sns-oauth/health.svg)](https://phpackages.com/packages/leo0o-sns-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)
