Download the PHP package wiseadmin/wise-oauth without Composer

On this page you can find all versions of the php package wiseadmin/wise-oauth. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package wise-oauth

wiseadmin/wise-oauth

为 ThinkPHP 6/8 提供的第三方 OAuth 登录包——支持微信/QQ/GitHub/钉钉/Google/微博/码云八大平台,自动关联或创建账号,多账号绑定解绑,零外部依赖。

PHP Version ThinkPHP Packagist


特性

模块 说明
8 个内置平台 微信开放平台、微信公众号、QQ 互联、GitHub、钉钉、Google、微博、码云(Gitee)
零外部依赖 纯 PHP 实现,仅需 PHP >= 8.0 + ThinkPHP 6/8
自动登录/注册 OAuthUserResolver 五级匹配链(unionId → openid → email → mobile → 创建新用户)
多账号绑定 一个平台账号可绑定多个本地用户,一个本地用户可绑定多个平台
State/CSRF 防护 OAuthStateManager 内置 CSRF 防护,可选 PKCE(RFC 7636)增强安全性
Token 加密存储 OAuthTokenEncryptor AES-256-CBC 加密 access_token/refresh_token
HasOAuth Trait Admin/Member 挂载即获绑定/解绑/查询能力
多态绑定表 oauth_users 表(user_type + user_id),不侵入用户原表
双控制器 AdminOAuthController(Session + redirect) / ApiOAuthController(JWT + JSON)
事件驱动 OAuthUserLoggedIn / OAuthUserRegistered / OAuthUserBound / OAuthUserUnbound
Facade 门面 OAuth::getAuthUrl() / OAuth::handleCallback() 一行搞定

安装


配置

发布配置和数据库迁移:

配置文件 config/wise-oauth.php:


使用指南

1. 用户模型接入(HasOAuth Trait)

HasOAuth 提供以下方法:

方法 说明
getOAuthBindings() 获取所有绑定列表
bindOAuth(OAuthUserInfo $info) 绑定平台账号
unbindOAuth(string $platform) 解绑平台账号
hasOAuthBinding(string $platform) 检查绑定状态
getOAuthUserByPlatform(string $platform) 通过平台查询绑定

2. 获取授权跳转 URL

3. 处理 OAuth 回调

4. 绑定/解绑账号

5. 在模型中直接操作

6. OAuthUserInfo 结构

回调返回的标准化用户信息:

7. 事件监听

8. 自定义驱动


平台配置速查

平台 标识 申请地址
GitHub github https://github.com/settings/developers
码云 gitee https://gitee.com/oauth_applications
Google google https://console.cloud.google.com/apis/credentials
QQ 互联 qq https://connect.qq.com
微信开放平台 wechat_open https://open.weixin.qq.com
微信公众号 wechat_mp https://mp.weixin.qq.com
钉钉 dingtalk https://open.dingtalk.com
微博 weibo https://open.weibo.com

目录结构


License

MIT


All versions of wise-oauth with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
topthink/framework Version ^8.0
wiseadmin/wise-support Version 1.0.*
ext-json Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package wiseadmin/wise-oauth contains the following files

Loading the files please wait ...