PHPackages                             shulinqian/auth - 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. shulinqian/auth

ActiveThinkweb-extend[Authentication &amp; Authorization](/categories/authentication)

shulinqian/auth
===============

php通用权限auth库

v0.0.5(8y ago)220Apache-2.0PHP

Since Nov 25Pushed 8y ago1 watchersCompare

[ Source](https://github.com/shulinqian/auth)[ Packagist](https://packagist.org/packages/shulinqian/auth)[ RSS](/packages/shulinqian-auth/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (6)Used By (0)

通用权限
====

[](#通用权限)

设计初衷：当不用现成框架写一个系统的时候，发现每次都要去写auth模块，其他框架的auth和框架耦合度太高，独立不出来，因此开发了此模块

QQ群：647344518 [立即加群](http://shang.qq.com/wpa/qunwpa?idkey=83a58116f995c9f83af6dc2b4ea372e38397349c8f1973d8c9827e4ae4d9f50e)
出品： [成都新数科技有限公司 http;//www.xinshukeji.com](http;//www.xinshukeji.com)
体验地址：

### 1. 简介

[](#1-简介)

auth提供2中认证模式，基于$\_SESSION的认证，和基于token的api认证

### 2. 使用

[](#2-使用)

详细使用见src/demo目录，web是session auth模式，api是token auth

```
composer require shulinqian/auth

```

#### 配置:

[](#配置)

```
$sessionStore = new MySessionStore();
$rightsManger = new MyRightsManger();
$config = [
    /* 有默认值 */
    'userNameKey' => 'phone', //登录字段
    'passwordKey' => 'password', //密码字段
    'sessionStoreKey' => 'login_user', //身份前缀
    'sessionStoreOption' => [], //$_SESSION或者memcached等的参数
    'sessionStore' => $sessionStore, //身份保持存储对象
    'useYield' => false, //异步协程模式，swoole等异步框架下可用
    'rightsManger' => $rightsManger, //权限管理对象

    /* 无默认值，需要设置 */
    'model' => new \UserModel(),  //user对象，返回查询数据和权限数据
];

```

### 3. 快速测试

[](#3-快速测试)

找个空目录(前提安装好composer),初始化项目，一直回车就好

```
composer init
composer install
composer require shulinqian/auth

```

安装完成后，运行服务器

```
php7 -S 0.0.0.0:9008

```

然后浏览器访问你的ip

至此，大功告成，可根据自己的系统快速集成一个认证和简易权限验证的功能，

立即开始愉快的旅程吧
==========

[](#立即开始愉快的旅程吧)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

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

Total

5

Last Release

3051d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/26e36c8d7e37a188cea18a232fb883576c4ec3000394179f703e3c17397f3e8b?d=identicon)[shulinqian](/maintainers/shulinqian)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/shulinqian-auth/health.svg)

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

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