csi-uksw/laravel-cas
Composer 安装命令:
composer require csi-uksw/laravel-cas
包简介
UKSW CAS auth module for Laravel 5.1
README 文档
README
Versions
Version 1.0 requires PHP 5.5.9+.
Laravel 5.1
To install this package pull it in through Composer.
composer require csi-uksw/laravel-cas
After Composer is done, you need to tell your application to use the CAS service provider.
Open config/app.php and add the service provider
CSI_UKSW\Laravel\CAS\CASServiceProvider::class
after
Illuminate\Auth\AuthServiceProvider::class
As well the Facade :
'CAS' => CSI_UKSW\Laravel\CAS\Facades\CAS::class
Configuration
Basic
To set up your CAS for connections you have to publish CAS config. This will provide all the configuration values for your connection.
php artisan vendor:publish --provider="CSI_UKSW\Laravel\CAS\CASServiceProvider"
After that please edit your app/cas.php. Using the .env file will allow you to have different environments without even touching the app/cas.php config file.
Middleware
Optionally you can use provided Auth Middleware.
After publishing please edit your app/Http/Kernel.php
protected $routeMiddleware = [ 'auth.cas' => \CSI_UKSW\Laravel\CAS\Http\Middleware\CASAuthMiddleware::class ];
Usage
Authenticate:
CAS::authenticate()
Logout:
CAS::logout()
Get username:
CAS::getUser()
Get user attributes:
CAS::getAttributes()
Check if is authenticated:
CAS::isAuthenticated()
Route middleware:
Route::group(['middleware' => 'auth.cas'], function () { get('cas', function(){ echo 'authorized only'; }); });
csi-uksw/laravel-cas 适用场景与选型建议
csi-uksw/laravel-cas 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 136 次下载、GitHub Stars 达 3, 最近一次更新时间为 2015 年 11 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「cas」 「CSI」 「UKSW」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 csi-uksw/laravel-cas 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 csi-uksw/laravel-cas 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 csi-uksw/laravel-cas 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Streaming terminal emulator, built on top of ReactPHP.
Add CAS server SSO authentication to Laravel 4 and 5
CAS bundle for PuMuKIT
Basic CAS (SSO) authenticator for Symfony 5.4, 6.0, 7.0 and 8.0
Symfony Lock Component
Provides a simple API for authenticating users against a CAS server
统计信息
- 总下载量: 136
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 8
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-11-19