All Projects → Yurunsoft → Yurunoauthlogin

Yurunsoft / Yurunoauthlogin

Licence: mit
PHP 第三方登录授权 SDK,集成了QQ、微信、微博、Github等常用接口。支持 php-fpm 和 Swoole,所有框架通用。QQ群:17916227

Projects that are alternatives of or similar to Yurunoauthlogin

Swoole Docker
See: https://github.com/swoole/docker-swoole
Stars: ✭ 132 (-60%)
Mutual labels:  coroutine, swoole
Simps
🚀 A simple, lightweight and high-performance PHP coroutine framework.
Stars: ✭ 318 (-3.64%)
Mutual labels:  coroutine, swoole
Aint Queue
🚀 An async-queue library built on top of swoole, flexable multi-consumer, coroutine supported. 基于 Swoole 的一个异步队列库,可弹性伸缩的工作进程池,工作进程协程支持。
Stars: ✭ 143 (-56.67%)
Mutual labels:  coroutine, swoole
Yii2 Swoole
full solutions making yii2-framework run on swoole with coroutine.
Stars: ✭ 86 (-73.94%)
Mutual labels:  coroutine, swoole
zhamao-framework
协程、高性能、灵活的聊天机器人 & Web 开发框架(炸毛框架)
Stars: ✭ 99 (-70%)
Mutual labels:  swoole, coroutine
Mix
☄️ PHP CLI mode development framework, supports Swoole, WorkerMan, FPM, CLI-Server / PHP 命令行模式开发框架,支持 Swoole、WorkerMan、FPM、CLI-Server
Stars: ✭ 1,753 (+431.21%)
Mutual labels:  coroutine, swoole
Yii2 Swoole
make yii2 project runing on swoole
Stars: ✭ 161 (-51.21%)
Mutual labels:  coroutine, swoole
Swpdo
Swoole Coroutine SQL component like PDO | 0成本迁移PDO到Swoole高性能协程客户端
Stars: ✭ 64 (-80.61%)
Mutual labels:  coroutine, swoole
ext-postgresql
🐘 Coroutine-based client for PostgreSQL
Stars: ✭ 62 (-81.21%)
Mutual labels:  swoole, coroutine
Yurunhttp
YurunHttp 是开源的 PHP HTTP 客户端,支持链式操作,简单易用。完美支持Curl、Swoole 协程。QQ群:17916227
Stars: ✭ 197 (-40.3%)
Mutual labels:  coroutine, swoole
Ycsocket
基于swoole的socket框架,支持协程版MySQL、Redis连接池,已用于大型RPG游戏服务端
Stars: ✭ 77 (-76.67%)
Mutual labels:  coroutine, swoole
PHPMailer-Swoole
安装最新版Swoole,开启一键协程化,使用原版phpmailer就可以实现协程化了。本项目已经没有维护下去的意义。
Stars: ✭ 25 (-92.42%)
Mutual labels:  swoole, coroutine
Php Coroutine Engine
This project for php-fpm support coroutine
Stars: ✭ 74 (-77.58%)
Mutual labels:  coroutine, swoole
Archer
基于协程Swoole的Task组件,支持多种模式。轻松实现协程Task的队列、并发、Defer、计时器等 | Swoole coroutine task kit - Swoole Humanization Library
Stars: ✭ 132 (-60%)
Mutual labels:  coroutine, swoole
Swoft Framework
[READ ONLY] Swoft Framework, base of Swoft
Stars: ✭ 70 (-78.79%)
Mutual labels:  coroutine, swoole
Guzzle Swoole
让基于 Guzzle 的项目完美无缝兼容 Swoole 协程,支持:Guzzle、Elasticsearch client——来自宇润 PHP 全家桶
Stars: ✭ 143 (-56.67%)
Mutual labels:  coroutine, swoole
Swoft Db
[READ ONLY] Database Compoment for Swoft
Stars: ✭ 25 (-92.42%)
Mutual labels:  coroutine, swoole
Saber
⚔️ Saber, PHP异步协程HTTP客户端 | PHP Coroutine HTTP client - Swoole Humanization Library
Stars: ✭ 866 (+162.42%)
Mutual labels:  coroutine, swoole
Hyperf Skeleton
🛠 A skeleton of Hyperf framework that provided by official team
Stars: ✭ 162 (-50.91%)
Mutual labels:  coroutine, swoole
swoole-postgresql-doctrine-driver
🔌 A Doctrine DBAL Driver implementation on top of Swoole Coroutine PostgreSQL client
Stars: ✭ 15 (-95.45%)
Mutual labels:  swoole, coroutine

YurunOAuthLogin

Latest Version IMI Doc IMI License

介绍

YurunOAuthLogin是一个PHP 第三方登录授权 SDK,集成了QQ、微信、微博、Github等常用接口。

无框架依赖,支持所有框架,支持 Swoole 协程环境。

我们有完善的在线技术文档:http://doc.yurunsoft.com/YurunOAuthLogin

API 文档:https://apidoc.gitee.com/yurunsoft/YurunOAuthLogin

宇润PHP全家桶群:17916227 点击加群,如有问题会有人解答和修复。

程序员日常划水群:74401592 点击加群

大家在开发中肯定会对接各种各样的第三方平台,我个人精力有限,欢迎各位来提交 PR (Github),一起完善它,让它能够支持更多的平台,更加好用。

支持的登录平台

  • QQ、QQ 小程序
  • 微信网页扫码、微信公众号、微信小程序
  • 支付宝网页、支付宝 APP、支付宝小程序
  • 微博
  • 百度
  • Github
  • Gitee
  • Coding
  • 开源中国(OSChina)
  • CSDN

后续将不断添加新的平台支持,也欢迎你来提交PR,一起完善!

安装

在您的composer.json中加入配置:

PHP >= 7.1.0

{
    "require": {
        "yurunsoft/yurun-oauth-login": "~3.0"
    }
}

PHP >= 5.4.0 && PHP < 7.1.0

{
    "require": {
        "yurunsoft/yurun-oauth-login": "~2.0"
    }
}

3.x 版本支持 PHP >= 7.1,持续迭代维护中

2.x 版本支持 PHP >= 5.4,支持长期 BUG 维护,保证稳定可用,停止功能性更新

代码实例

自v1.2起所有方法统一参数调用,如果需要额外参数的可使用对象属性赋值,具体参考test目录下的测试代码。

下面代码以QQ接口举例,完全可以把QQ字样改为其它任意接口字样使用。

实例化

$qqOAuth = new \Yurun\OAuthLogin\QQ\OAuth2('appid', 'appkey', 'callbackUrl');

登录

$url = $qqOAuth->getAuthUrl();
$_SESSION['YURUN_QQ_STATE'] = $qqOAuth->state;
header('location:' . $url);

回调处理

// 获取accessToken
$accessToken = $qqOAuth->getAccessToken($_SESSION['YURUN_QQ_STATE']);

// 调用过getAccessToken方法后也可这么获取
// $accessToken = $qqOAuth->accessToken;
// 这是getAccessToken的api请求返回结果
// $result = $qqOAuth->result;

// 用户资料
$userInfo = $qqOAuth->getUserInfo();

// 这是getAccessToken的api请求返回结果
// $result = $qqOAuth->result;

// 用户唯一标识
$openid = $qqOAuth->openid;

解决第三方登录只能设置一个回调域名的问题

// 解决只能设置一个回调域名的问题,下面地址需要改成你项目中的地址,可以参考test/QQ/loginAgent.php写法
$qqOAuth->loginAgentUrl = 'http://localhost/test/QQ/loginAgent.php';

$url = $qqOAuth->getAuthUrl();
$_SESSION['YURUN_QQ_STATE'] = $qqOAuth->state;
header('location:' . $url);

Swoole 协程环境支持

\Yurun\Util\YurunHttp::setDefaultHandler('Yurun\Util\YurunHttp\Handler\Swoole');

特别鸣谢

捐赠

开源不求盈利,多少都是心意,生活不易,随缘随缘……

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].