{"id":34674924,"url":"https://github.com/pl1998/thirdparty_oauth","last_synced_at":"2025-12-24T20:21:34.080Z","repository":{"id":50868853,"uuid":"295677202","full_name":"pl1998/thirdparty_oauth","owner":"pl1998","description":"这是一个php第三方授权登录包🎉","archived":false,"fork":false,"pushed_at":"2021-05-17T09:29:33.000Z","size":399,"stargazers_count":36,"open_issues_count":3,"forks_count":9,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-30T21:41:41.574Z","etag":null,"topics":["laravel","oauth2","php","thinkphp"],"latest_commit_sha":null,"homepage":"https://pltrue.top/article/28","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pl1998.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-15T09:22:26.000Z","updated_at":"2025-08-14T20:20:50.000Z","dependencies_parsed_at":"2022-09-22T14:24:55.690Z","dependency_job_id":null,"html_url":"https://github.com/pl1998/thirdparty_oauth","commit_stats":null,"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"purl":"pkg:github/pl1998/thirdparty_oauth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pl1998%2Fthirdparty_oauth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pl1998%2Fthirdparty_oauth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pl1998%2Fthirdparty_oauth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pl1998%2Fthirdparty_oauth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pl1998","download_url":"https://codeload.github.com/pl1998/thirdparty_oauth/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pl1998%2Fthirdparty_oauth/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28007937,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-24T02:00:07.193Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["laravel","oauth2","php","thinkphp"],"created_at":"2025-12-24T20:21:30.626Z","updated_at":"2025-12-24T20:21:34.074Z","avatar_url":"https://github.com/pl1998.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eThirdpartyOauth\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n\n\u003ca href=\"https://packagist.org/packages/pltrue/thirdparty_oauth\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT-green\" /\u003e\u003c/a\u003e \n[![Build Status](https://travis-ci.org/pl1998/thirdparty_oauth.svg?branch=master)](https://travis-ci.org/pl1998/thirdparty_oauth)\n![StyleCI build status](https://github.styleci.io/repos/295677202/shield)\n\u003ca href=\"https://packagist.org/packages/pltrue/thirdparty_oauth\"\u003e\u003cimg src=\"https://img.shields.io/badge/php-v7.0+-blue\" /\u003e\u003c/a\u003e \n\u003ca href=\"https://packagist.org/packages/pltrue/thirdparty_oauth\"\u003e\u003cimg src=\"https://img.shields.io/badge/downloads-37-brightgreen\" /\u003e\u003c/a\u003e \n\u003c/p\u003e\n\n\n\u003cp\u003e这是一个社会化登录的第三方登录扩展包 \u003c/p\u003e\n\nv2.0版本兼容 [Laravel-Octane](https://github.com/laravel/octane)\n\n\n\n\n## 安装\n\n使用 composer 安装: \n\n```shell\n$ composer require pltrue/thirdparty_oauth \"v1.7\"\n```\n\n## 贡献\n你可以通过以下三种方式做出贡献:\n\n1. bug反馈   [issue tracker](https://github.com/pl1998/thirdparty_oauth/issues).\n2. 回答问题或修复错误 [issue tracker](https://github.com/pl1998/thirdparty_oauth/issues).\n3. 贡献新特性或更新wiki。\n\n## 目前支持第三方登录\n\n * 1.QQ(app/h5/web)\n * 2.微信(web扫码)\n * 3.微博(app/h5/web)\n * 4.小米(web/h5)\n * 5.抖音\n * 6.世纪互联(微软)\n * 7.微软\n * 8.gitee\n * 9.github\n * 10.gitlab\n * 11.google\n * 12.line\n\n\u003chr\u003e\n\n\n## 贡献者🎉、以及合并日志\n\n| 日期   | 更新级别 | 更新内容      | 贡献者 | 当前状态 |\n| ------| -------- | --------- | ---- | ---- |\n| 2020-12-06|   fix 、feat   | 新增`Microsoft`登录 修复微信、QQ的bug   | [742481030](https://github.com/742481030)     | 已合并到master分支     |\n| 2020-12-08|   feat         | 新增`小米账户`登录    | [742481030](https://github.com/742481030)  | 已合并到master分支     |\n| 2020-12-09|   feat         | 新增`google账户`登录    | [742481030](https://github.com/742481030)  | 已合并到master分支     |\n| 2020-12-10|   feat         | 新增`华为账户`登录    | [742481030](https://github.com/742481030)  | 已合并到master分支     |\n| 2020-12-11|   fix         | qq统一使用json接口    | [742481030](https://github.com/742481030)  | 已合并到master分支     |\n| 2020-12-12|   feat         | 新增`抖音账户`登录    | [742481030](https://github.com/742481030)  | 已合并到master分支     |\n| 2020-12-13|   feat         | 新增`Line账户`登录    | [742481030](https://github.com/742481030)  | 已合并到master分支     |\n| 2020-12-29|   fix         | 增加兼容支付宝qq app混合应用兼容   | [742481030](https://github.com/742481030)  | 已合并到master分支     |\n| 2020-12-29|   feat         | 新增`京东账户`登录    | [742481030](https://github.com/742481030)  | 已合并到master分支     |\n| 2020-12-29|   fix          | 兼容laravel7*    | [pl1998](https://github.com/pl1998)  | 已合并到master分支     |\n| 2021-04-19|   feat          | 兼容laravel8* 支持laravel发布配置文件   | [pl1998](https://github.com/pl1998)  | 已合并到master分支     |\n| 2021-05-15|   feat          | v2.0版本 兼容laravel8* Laravel Octane 常驻内存   | [pl1998](https://github.com/pl1998)  | 已合并到master分支     |\n\n\n## 如何申请应用授权？\n   * [github应用创建地址](https://github.com/settings/developers)\n   * [gitee应用创建地址](https://gitee.com/oauth/applications)\n   * [gitlab应用创建地址](https://gitlab.com/oauth/applications)\n   * [微博应用创建地址](https://open.weibo.com/)\n   * [microcoft应用创建地址](https://azure.com/)\n   * [QQ互联创建地址](https://connect.qq.com/index.html)\n   * [小米应用](https://dev.mi.com/console/)\n   * [google应用](https://console.developers.google.com)\n   * [京东应用](https://jos.jd.com/)\n   \n\n##### 参数说明 \n\n\u003e   \u003ckbd\u003eredirect_url\u003c/kbd\u003e   回调地址将使用方法写到回调接口即可 获取到用户的一些基础信息 \u003cbr/\u003e\n\u003e   \u003ckbd\u003eclient_id\u003c/kbd\u003e     应用授权id \u003cbr/\u003e\n\u003e   \u003ckbd\u003eclient_secret\u003c/kbd\u003e  应用授权key \u003cbr/\u003e\n\u003e    所有支持平台的类型 `github` `gitee` `gitlab` `weibo` `qq` `weixin` `alipay` `microsoft` 配置文件下标一致\n\n\n\n##### 建议\n\n\u003e 前后端分离下建议前端直接请求授权接口，后端负责回调接口即可\n\n#### PHP-FPM下安装\n```shell script\ncomposer require pltrue/thirdparty_oauth \"v1.7\"\n```\n#### Laravel Octane  常驻内存下安装\n```shell script\ncomposer require pltrue/thirdparty_oauth \"v2.0\"\n```\n#### 发布配置\n\n```shell script\nphp artisan vendor:publish --tag=oauth \n```\n\n### 简单使用\n\n   * 授权方法\n````php\n$api = new SocialiteAuth(config('oauth.github'));\nreturn $api-\u003eredirect('github');\n\n````\n   *回调方法\n\n```php\npublic function githubCallBack()\n    {\n        $auth = new SocialiteAuth(config('oauth.github'));\n        $user = $auth-\u003edriver('github')-\u003euser();\n\n        $users = User::query()-\u003ewhere('oauth_id',$user-\u003eid)-\u003efirst();\n\n        if(!$users){\n            $users= User::query()-\u003ecreate([\n                'name'=\u003e empty($user-\u003ename) ?? $user-\u003elogin,\n                'email'=\u003e$user-\u003eemail,\n                'avatar'=\u003e$user-\u003eavatar_url,\n                'oauth_id'=\u003e$user-\u003eid,\n                'bound_oauth'=\u003e1\n            ]);\n        }\n        return $this-\u003erespondWithToken($users);\n    }\n```\n\n## 返回示例\n\n![在这里插入图片描述](https://img-blog.csdnimg.cn/20210115174351473.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQyMDMyMTE3,size_16,color_FFFFFF,t_70#pic_center)\n\n\u003cbr/\u003e\n\n## License\n\u003chr\u003e\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpl1998%2Fthirdparty_oauth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpl1998%2Fthirdparty_oauth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpl1998%2Fthirdparty_oauth/lists"}