PHPackages                             decent/wechat - 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. decent/wechat

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

decent/wechat
=============

WeChat Auth

v1.5.0(8y ago)2481MITPHPPHP &gt;= 5.5.30

Since Mar 30Pushed 7y ago1 watchersCompare

[ Source](https://github.com/Decent-Dexter/QYH-Auth)[ Packagist](https://packagist.org/packages/decent/wechat)[ RSS](/packages/decent-wechat/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (4)DependenciesVersions (5)Used By (0)

微信企业号授权登录
=========

[](#微信企业号授权登录)

安装
--

[](#安装)

1. 使用composer下载扩展包
    `composer require decent/wechat`
2. 在项目 config/app.php 文件中的providers数组中，添加以下代码引入服务提供器
    `Decent\Wechat\WechatServiceProvider::class`
3. 运行以下命令，将配置文件发布到config文件夹
    `php artisan vendor:publish`

配置
--

[](#配置)

##### 企业号id - `corp_id`

[](#企业号id---corp_id)

##### 企业号secret - `corp_secret`

[](#企业号secret---corp_secret)

##### 认证回调地址 - `auth_action`

[](#认证回调地址---auth_action)

一个URL地址。
用户使用微信企业号登录，扫码后会重定向到这个URL，附带用户认证的code。
可在这个URL中添加认证的业务逻辑

##### 实现提供器 - `providers`

[](#实现提供器---providers)

认证流程需要用到以下几个实现，其中session和微信认证已有默认提供器：

1. 查找用户
    需要提供根据企业号成员ID获取用户model的函数
2. 保存Session 用户登录时保存session，登出时销毁session
3. 微信认证
    认证登录页重定向回来的code，获取企业号用户ID

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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.

###  Release Activity

Cadence

Every ~18 days

Total

4

Last Release

3279d ago

### Community

---

Top Contributors

[![ba6yface](https://avatars.githubusercontent.com/u/12292869?v=4)](https://github.com/ba6yface "ba6yface (6 commits)")

### Embed Badge

![Health badge](/badges/decent-wechat/health.svg)

```
[![Health](https://phpackages.com/badges/decent-wechat/health.svg)](https://phpackages.com/packages/decent-wechat)
```

###  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)
