PHPackages                             sy-records/oauth-login - 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. sy-records/oauth-login

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

sy-records/oauth-login
======================

This is an extension that integrates third-party logins.

v1.2.1(7y ago)10712GPL-3.0PHPPHP &gt;= 5.4.0

Since Jul 11Pushed 7y agoCompare

[ Source](https://github.com/sy-records/OAuthLogin)[ Packagist](https://packagist.org/packages/sy-records/oauth-login)[ RSS](/packages/sy-records-oauth-login/feed)WikiDiscussions master Synced today

READMEChangelog (3)DependenciesVersions (4)Used By (0)

OAuthLogin
==========

[](#oauthlogin)

✨ PHP 第三方登录授权 SDK，集成中！

目前已经集成好了QQ、微博、Github的授权登录，能够拿到用户信息，但是可能还是有一些地方没有考虑到，未做处理，后期再继续修改吧

参与我
---

[](#参与我)

如果有任何想法或需求，可以在 issue 中告诉我，同时也欢迎各种 pull requests

环境依赖
----

[](#环境依赖)

PHP5.4以上，且需要开启curl扩展、session.auto\_start扩展

安装
--

[](#安装)

### composer安装

[](#composer安装)

```
composer require sy-records/oauth-login

```

### 手动加载

[](#手动加载)

需要什么登录就引入什么登录文件，例如test中demo

用法
--

[](#用法)

### 演示Demo

[](#演示demo)

访问test文件中的index.html。补全对应文件夹中index.php和callback.php中的参数即可

### Demo截图

[](#demo截图)

 [![](./test/images/demo.jpg)](./test/images/demo.jpg)

### QQ授权登录

[](#qq授权登录)

```
use Auth\QqConnect;

# https://connect.qq.com/manage.html#/ 创建应用
$appId = ''; # APP ID
$appKey = '';# APP Key
$callBackUrl = ''; # 授权回调地址

$qqAuth = new QqConnect($appId,$appKey,$callBackUrl);
# 授权登录页面
$qqAuth->qqLogin();
# 授权回调方法
$res = $qqAuth->qqCallBack();
var_dump($res); # 用户信息
```

### 微博授权登录

[](#微博授权登录)

```
use Auth\WeiboConnect;

# http://open.weibo.com/apps/new?sort=web 创建网站应用
$appKey = ''; # 网站应用申请后的App Key
$appSecret = ''; # 网站应用申请后的App Secret
$callback = ''; # 授权回调地址

$weiboAuth = new WeiboConnect($appKey,$appSecret,$callback);
# 授权登录页面
$weiboAuth->weiboLogin();
# 授权回调方法
$res = $weiboAuth->weiboCallBack();
var_dump($res); # 用户信息
```

### Github授权登录

[](#github授权登录)

```
use Auth\GithubConnect;

# https://github.com/settings/developers 创建OAuth App
$clientId = ''; # 创建OAuth App得到的Client ID
$clientSecret = ''; # 创建OAuth App得到的Client Secret
$callback = ''; # Authorization callback URL 回调地址

$githubAuth = new GithubConnect($clientId,$clientSecret,$callback);
# 授权登录页面
$githubAuth->githubLogin();
# 授权回调方法
$res = $githubAuth->githubCallBack();
var_dump($res); # 用户信息
```

版权信息
----

[](#版权信息)

本SDK由沈唁集成，遵循GPL3.0开源协议发布，并提供免费使用

版权所有Copyright © 2018 by 沈唁志

All rights reserved

更多细节参阅 [LICENSE](https://github.com/sy-records/OAuthLogin/blob/master/LICENSE)

赞助
--

[](#赞助)

若对您有帮助，可以赞助并支持下作者哦，谢谢！

 [![](https://camo.githubusercontent.com/0461fe6ad7d3101afd41dbc952c23c14f3747d38115e04a0f74cd542f6801c05/687474703a2f2f7778332e73696e61696d672e636e2f6d773639302f303036306c6d37546c7931667376386e76626330716a33306d383068713432352e6a7067)](https://camo.githubusercontent.com/0461fe6ad7d3101afd41dbc952c23c14f3747d38115e04a0f74cd542f6801c05/687474703a2f2f7778332e73696e61696d672e636e2f6d773639302f303036306c6d37546c7931667376386e76626330716a33306d383068713432352e6a7067)

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

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

3

Last Release

2860d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/17615e789eec7042f64c6f4e8733421987d98fcdc4269395b42d2a7f0ae94301?d=identicon)[sy-records](/maintainers/sy-records)

---

Top Contributors

[![sy-records](https://avatars.githubusercontent.com/u/33931153?v=4)](https://github.com/sy-records "sy-records (34 commits)")

---

Tags

githubqqweibophpgithubqqweiboOAuthLogin2.0

### Embed Badge

![Health badge](/badges/sy-records-oauth-login/health.svg)

```
[![Health](https://phpackages.com/badges/sy-records-oauth-login/health.svg)](https://phpackages.com/packages/sy-records-oauth-login)
```

###  Alternatives

[hwi/oauth-bundle

Support for authenticating users using both OAuth1.0a and OAuth2 in Symfony.

2.4k21.5M69](/packages/hwi-oauth-bundle)[overtrue/socialite

A collection of OAuth 2 packages.

1.4k5.5M87](/packages/overtrue-socialite)

PHPackages © 2026

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