PHPackages                             hwacom/client-sso - 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. hwacom/client-sso

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

hwacom/client-sso
=================

SSO Client Package

v2.6.0(9mo ago)01.1k1MITPHPPHP ^8.3CI failing

Since Mar 2Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/HwacomService/SSO-Client)[ Packagist](https://packagist.org/packages/hwacom/client-sso)[ RSS](/packages/hwacom-client-sso/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (3)DependenciesVersions (6)Used By (1)

SSO Client Package via Hwacom SSO
=================================

[](#sso-client-package-via-hwacom-sso)

[![Build Status](https://github.com/mozielin/Client-SSO/workflows/PHP Composer/badge.svg)](https://github.com/mozielin/Client-SSO/actions)[![Total Downloads](https://camo.githubusercontent.com/2db62124c9cd0207edeb7a389cb6c5adfe1e16338ba7221546299aac04ff1733/687474703a2f2f706f7365722e707567782e6f72672f687761636f6d2f636c69656e742d73736f2f646f776e6c6f616473)](https://packagist.org/packages/hwacom/client-sso)[![Latest Stable Version](https://camo.githubusercontent.com/ece3f14933e8a5667f2015e53b5841d38a9ee300762dcce0995aa441db2e0225/687474703a2f2f706f7365722e707567782e6f72672f687761636f6d2f636c69656e742d73736f2f76)](https://packagist.org/packages/hwacom/client-sso)

前言
--

[](#前言)

要用我華電SSO必先安裝客戶端

安裝說明
----

[](#安裝說明)

```
composer require hwacom/client-sso
```

Service Provider設定 (Laravel 5.5^ 會自動掛載)
---------------------------------------

[](#service-provider設定-laravel-55-會自動掛載)

Composer安裝完後要需要修改 `config/app.php` 找到 providers 區域並添加:

```
\Hwacom\SSO\SSOServiceProvider::class,
```

Config設定檔發佈
-----------

[](#config設定檔發佈)

用下列指定會建立sso.php設定檔，需要在 `.env` 檔案中增加設定.

```
php artisan vendor:publish
```

下列設定會自動增加在 `config/sso.php`

```
'sso_enable'    => env('SSO_ENABLE',false),
'client_secret' => env("SSO_CLIENT_SECRET"),
'callback'      => env("SSO_CLIENT_CALLBACK"),
'sso_host'      => env("SSO_HOST")
```

在`.env` 中增加設定

```
SSO_ENABLE          = true
SSO_HOST            = http://test.eip.hwacom.com:8000
SSO_CLIENT_SECRET   = ELg5TA5b5JTEJUCdDGoRo0mZIKQe1EuoF8W6ytvP
SSO_CLIENT_CALLBACK = http://test.crm.hwacom.com:8080/callback
```

\[LoginController\] 增加兩個Function
--------------------------------

[](#logincontroller-增加兩個function)

Login

```
/**
 * 登入頁面置換，需自行寫入LoginController中
 * Laravel7 Function Name 改為 showLoginForm
 */
public function create()
{
    if (config('sso.sso_enable') === true ) {
        setcookie("callback", config('sso.callback'), 0, "/", '.hwacom.com');
        return redirect(config("sso.sso_host") .  "/google/auth");
    }
    return view('auth.login');
}

```

Logout

```
/**
 * 登出用需自行寫入LoginController中
 *
 * @param  \Illuminate\Http\Request  $request
 * @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\JsonResponse
 */
public function destroy(Request $request)
{
    if (config('sso.sso_enable') === true ) {
        setcookie("token", "", time() - 3600, '/', '.hwacom.com');
    }

    Auth::guard('web')->logout();

    $request->session()->invalidate();

    $request->session()->regenerateToken();

    return redirect(config("sso.sso_host"));
}

```

\[Middleware\] 增加至`Http/Kernel.php`web Group中
---------------------------------------------

[](#middleware-增加至httpkernelphpweb-group中)

```
\Hwacom\ClientSso\Middleware\SSOAuthenticated::class,
```

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance56

Moderate activity, may be stable

Popularity17

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity68

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

Total

5

Last Release

295d ago

Major Versions

v1.0.1 → v2.5.12022-03-03

### Community

Maintainers

![](https://www.gravatar.com/avatar/76101f5a95034572964a49b9cb2032caeaac4526b9f418afadfc34a3952853b5?d=identicon)[HwacomService](/maintainers/HwacomService)

---

Top Contributors

[![mozielin](https://avatars.githubusercontent.com/u/33715982?v=4)](https://github.com/mozielin "mozielin (13 commits)")

### Embed Badge

![Health badge](/badges/hwacom-client-sso/health.svg)

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

###  Alternatives

[kartik-v/yii2-password

Useful password strength validation utilities for Yii Framework 2.0

761.2M17](/packages/kartik-v-yii2-password)[better-futures-studio/filament-local-logins

This is my package filament-local-logins

1334.6k](/packages/better-futures-studio-filament-local-logins)

PHPackages © 2026

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