PHPackages                             cann/laravel-admin-oauth - 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. cann/laravel-admin-oauth

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

cann/laravel-admin-oauth
========================

Laravel-Admin 的 OAuth 扩展

v1.1(5y ago)9737↓100%7[6 issues](https://github.com/cnny/laravel-admin-oauth/issues)MITPHP

Since Apr 29Pushed 5y ago1 watchersCompare

[ Source](https://github.com/cnny/laravel-admin-oauth)[ Packagist](https://packagist.org/packages/cann/laravel-admin-oauth)[ RSS](/packages/cann-laravel-admin-oauth/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (3)Versions (6)Used By (0)

Laravel-Admin-OAuth

 laravel-admin-oauth 是 [laravel-admin](https://laravel-admin.org/) 的 OAuth2.0 登录扩展，支持自定义扩展其他授权方 [![](https://camo.githubusercontent.com/c42ad03b2ec48225a1f1eea801cc5668980cc8e4d31b98af58c825b80cb5273f/68747470733a2f2f626c6f672d313235323331343431372e636f732e61702d7368616e676861692e6d7971636c6f75642e636f6d2f313538383832353936373239352e6a7067)](https://camo.githubusercontent.com/c42ad03b2ec48225a1f1eea801cc5668980cc8e4d31b98af58c825b80cb5273f/68747470733a2f2f626c6f672d313235323331343431372e636f732e61702d7368616e676861692e6d7971636c6f75642e636f6d2f313538383832353936373239352e6a7067) [![](https://camo.githubusercontent.com/bbd6b472214c0510357033dcc54fd2b0dfe644cd3763292270e528027f52c754/68747470733a2f2f626c6f672d313235323331343431372e636f732e61702d7368616e676861692e6d7971636c6f75642e636f6d2f313538383832363030363633352e6a7067)](https://camo.githubusercontent.com/bbd6b472214c0510357033dcc54fd2b0dfe644cd3763292270e528027f52c754/68747470733a2f2f626c6f672d313235323331343431372e636f732e61702d7368616e676861692e6d7971636c6f75642e636f6d2f313538383832363030363633352e6a7067)

### 支持授权方

[](#支持授权方)

---

- 企业微信
- 钉钉

### 依赖

[](#依赖)

---

- laravel-admin &gt;= 1.7

### 安装

[](#安装)

---

```
composer require cann/laravel-admin-oauth

```

### 发布资源

[](#发布资源)

```
php artisan vendor:publish --provider="Cann\Admin\OAuth\ServiceProvider"

```

执行：

```
php artisan migrate

```

### 配置

[](#配置)

path: `config/admin-oauth.php`

```
    'controller' => Cann\Admin\OAuth\Controllers\AuthController::class,

    // 是否允许账号密码登录
    'allowed_password_login' => true,

    // 当第三方登录未匹配到本地账号时，是否允许自动创建本地账号
    'allowed_auto_create_account_by_third' => false,

    // 启用的第三方登录
    'enabled_thirds' => [
        'WorkWechat',
    ],

    // 第三方登录秘钥
    'services' => [
        'work_wechat' => [
            'corp_id'  => env('WECHAT_WORK_CORP_ID', ''),
            'agent_id' => env('WECHAT_WORK_AGENT_ID', ''),
            'secret'   => env('WECHAT_WORK_AGENT_SECRET', ''),
        ]
    ]

```

### 扩展授权方

[](#扩展授权方)

继承 `Cann\Admin\OAuth\ThirdAccount\Thirds\ThirdAbstract`, 实现 `getAuthorizeUrl` &amp; `getThirdUser`。 然后在 `AppServerProvider` 中注册：

```
    \Cann\Admin\OAuth\ServiceProvider::extend(\App\Extensions\OAuth\WechatMp::class, 'WechatMp', '微信公众号');

```

修改 `config/admin-oauth.php` 即可:

```
    // 启用的第三方登录
    'enabled_thirds' => [
        'WechatMp',
        'WorkWechat',
    ],

    // 第三方登录秘钥
    'services' => [
        'work_wechat' => [
            'corp_id'  => env('WECHAT_WORK_CORP_ID'),
            'agent_id' => env('WECHAT_WORK_AGENT_ID'),
            'secret'   => env('WECHAT_WORK_AGENT_SECRET'),
        ],
        'wechat_mp' => [
            'app_id'  => env('WECHAT_OFFICIAL_ACCOUNT_APPID', ''),   // AppID
            'secret'  => env('WECHAT_OFFICIAL_ACCOUNT_SECRET', ''),   // AppSecret
            'token'   => env('WECHAT_OFFICIAL_ACCOUNT_TOKEN', ''),    // Token
            'aes_key' => env('WECHAT_OFFICIAL_ACCOUNT_AES_KEY', ''),  // EncodingAESKey
        ],
    ],

```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance7

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 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 ~13 days

Total

5

Last Release

2148d ago

Major Versions

v0.2 → v1.02020-05-08

### Community

Maintainers

![](https://www.gravatar.com/avatar/e1a271341437b80fe150d1de74c905291ce94bd48aa97ad7a02a77d9af294d6e?d=identicon)[cann](/maintainers/cann)

---

Top Contributors

[![cnny](https://avatars.githubusercontent.com/u/17918962?v=4)](https://github.com/cnny "cnny (11 commits)")

### Embed Badge

![Health badge](/badges/cann-laravel-admin-oauth/health.svg)

```
[![Health](https://phpackages.com/badges/cann-laravel-admin-oauth/health.svg)](https://phpackages.com/packages/cann-laravel-admin-oauth)
```

###  Alternatives

[josiasmontag/laravel-recaptchav3

Recaptcha V3 for Laravel package

2641.6M2](/packages/josiasmontag-laravel-recaptchav3)[rahul900day/laravel-captcha

Different types of Captcha implementation for Laravel Application.

10715.9k](/packages/rahul900day-laravel-captcha)[simplesamlphp/simplesamlphp-module-oidc

A SimpleSAMLphp module adding support for the OpenID Connect protocol

5016.9k1](/packages/simplesamlphp-simplesamlphp-module-oidc)[kinde-oss/kinde-auth-php

Kinde PHP SDK for authentication

2369.5k3](/packages/kinde-oss-kinde-auth-php)[descope/descope-php

Descope SDK for PHP

3814.0k](/packages/descope-descope-php)[asundust/auth-captcha

Sliding captcha for Laravel-Admin auth, Multiple platform support / Laravel-Admin登录 滑动验证插件 多平台支持

593.6k](/packages/asundust-auth-captcha)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
