PHPackages                             sj-phpteam/package-sso-client - 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. sj-phpteam/package-sso-client

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

sj-phpteam/package-sso-client
=============================

sso client login

0296PHP

Since Mar 20Pushed 7y ago1 watchersCompare

[ Source](https://github.com/sj-distributor/package-sso-client)[ Packagist](https://packagist.org/packages/sj-phpteam/package-sso-client)[ RSS](/packages/sj-phpteam-package-sso-client/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (1)Used By (0)

sso-client扩展包
=============

[](#sso-client扩展包)

### 1.安装

[](#1安装)

```
composer require sj-phpteam/package-sso-client dev-master

```

### 2.配置

[](#2配置)

1. 生成config文件和controller

    ```
    php artisan vendor:publish --tag=ssoClient

    ```

    config/ssoClient.php(如有需要自行配置)

    app/Http/Controllers/SsoClientController.php(如有需要自行编写function)
2. .env配置

    ```
    SSO_CLIENT_DOMAIN=域
    SSO_CLIENT_CLIENT_ID=客户端ID
    SSO_CLIENT_CLIENT_SECRET=客户端密钥
    SSO_CLIENT_REDIRECT_URI=回调地址
    SSO_CLIENT_AUTHORIZATION_SERVER=认证服务器地址
    SSO_CLIENT_AUTHENTICATION_TOKEN_ADDRESS=获取token地址
    SSO_CLIENT_WEB_REDIRECT_URI=返回主页地址
    ```
3. 添加路由中间件

    找到app/Http/Middleware/Kernel.php

    ```
    protected $routeMiddleware = [
    	'ssoClient'=>\Phpteam\SsoClient\Middleware\SsoClientVerity::class,
    ];
    ```
4. 设置路由

    找到route/web.php

    ```
    Route::group(['middleware' => 'ssoClient'], function () {
    	//填写要登录后才能进入到路由
    });
    ```
5. 注册守卫

    找到config/auth.php

    ```
    'guards' => [
    	'ssoClient' => [
    		'driver' => 'session',
    		'provider' => 'ssoClientUser'
    	],
    ],
    'providers' => [
    	'ssoClientUser' => [
    		'driver' => 'eloquent',
    		'model' => \Phpteam\SsoClient\Model\SsoClientUser::class,
    	],
    ],
    ```

### 3.用法

[](#3用法)

1. 获取登录用户信息

    ```
    //用户id
    SsoClient::getUserId();
    //用户名称
    SsoClient::getUserName();
    ```

    提示:用户信息目前仅有userId和userName

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/16334673?v=4)[Orange1996](/maintainers/Orange1996)[@orange1996](https://github.com/orange1996)

---

Top Contributors

[![sjfood-tom](https://avatars.githubusercontent.com/u/33740017?v=4)](https://github.com/sjfood-tom "sjfood-tom (1 commits)")

### Embed Badge

![Health badge](/badges/sj-phpteam-package-sso-client/health.svg)

```
[![Health](https://phpackages.com/badges/sj-phpteam-package-sso-client/health.svg)](https://phpackages.com/packages/sj-phpteam-package-sso-client)
```

###  Alternatives

[kartik-v/yii2-password

Useful password strength validation utilities for Yii Framework 2.0

761.2M17](/packages/kartik-v-yii2-password)

PHPackages © 2026

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