🔐
OAuth 2.1 Aggregated Login
5-platform unified access, 5-minute integration
Unified access for WeChat / Alipay / QQ / Douyin / self-hosted. Complete OAuth 2.1 flow, MD5 signature anti-replay, 5-minute code cache prevents 40163 duplicate consumption.
example.php
<?php
require 'vendor/autoload.php';
$um = new UM($appid, $appkey, $callback, $apiurl);
// 1. 生成登录跳转 URL
$state = bin2hex(random_bytes(16));
$loginUrl = $um->login('wx', $state);
header("Location: $loginUrl");
// 2. 回调获取用户信息
$user = $um->callback($_GET['code']);
// => ["openid"=>"oX...", "nickname"=>"张三", "avatar"=>"..."]
// 3. 二次查询
$info = $um->query('wx', $social_uid);Core Features
6 core features, each works standalone
5-platform unified access
WeChat/Alipay/QQ/Douyin/self-hosted, one SDK covers all
Anti-replay signature
MD5 dictionary order + 5-minute timestamp validity
5-minute code cache
Same code consumed only once within 5 minutes
CSRF protection
Optional state parameter returned as-is
4-platform SDK
PHP / JavaScript / Python / Mini-program
Secondary query
Query user info via social_uid without re-OAuth
API Endpoints
Via /api/* call the following endpoints
| Method | Path | Description |
|---|---|---|
| GET | /api/qrcode.php | Generate login QR code image |
| GET | /connect.php?act=login | Generate redirect URL |
| GET | /connect.php?act=callback | Exchange code for user info |
| GET | /connect.php?act=query | Secondary query by social_uid |
| GET | /connect.php?act=check_sso | SSO status check |