套件名稱 : js-adways/authenticator
開發年份 : 2024
gitHub連結 : https://github.com/JsAdways/js_Authenticator
內容簡介 :
多系統開發中很重要的一環,負責各系統使用者登入以及使用權限資料取得的統一處理套件
- Laravel:100%
安裝方式 :
composer require jsadways/authenticatorpublish 設定擋到專案中
php artisan vendor:publish --provider="Js\Authenticator\Providers\AuthServiceProvider"在專案.env中加入以下資訊
1.驗證中心的URL
2.本系統前端露出權限json的URL
JS_AUTH_HOST='http://authenticate.tw'
FORESTAGE_URL='http://172.16.1.156:3100/struct'使用方式,在router/api.php或router/web.php中加入middleware
// 在需驗證位置加入 js-authenticate-middleware-alias 中間件
Route::middleware(['js-authenticate-middleware-alias'])->group(function () {
// 路徑
});其他說明可參考 : Laravel 環境多系統登入驗證架構設計
![[作品][Laravel Packeage] authenticator : 跨系統登入驗證執行器](/2025/06/25/%E4%BD%9C%E5%93%81laravel-packeage-authenticator-%E8%B7%A8%E7%B3%BB%E7%B5%B1%E7%99%BB%E5%85%A5%E9%A9%97%E8%AD%89%E5%9F%B7%E8%A1%8C%E5%99%A8/feature_hu_a60d965fc8a44f0a.webp)