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

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

guanhui07/oauth-login
=====================

This is an extension that integrates third-party logins.

00PHP

Since Sep 19Pushed 1y agoCompare

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

READMEChangelogDependenciesVersions (1)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

14

—

LowBetter than 2% of packages

Maintenance29

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity17

Early-stage or recently created project

 Bus Factor1

Top contributor holds 97.1% 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://www.gravatar.com/avatar/3abde3fccf025ce86670101d7cfa0641d2415c9daad93e5f0c9573a2b23ddbda?d=identicon)[guanhui07](/maintainers/guanhui07)

---

Top Contributors

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

### Embed Badge

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

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

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

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

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

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