spacecoyotte / bookstack-cas
为 Bookstack 提供CAS身份验证中间件
dev-master
2019-11-04 10:17 UTC
Requires
- php: >=5.5.0
- apereo/phpcas: ~1.3.4
- illuminate/contracts: 5.x
- illuminate/http: 5.x
- illuminate/support: 5.x
This package is not auto-updated.
Last update: 2024-09-21 09:25:21 UTC
README
首先
请多多包涵:这是我第一个包...这个包的大部分文件都是从 sentrasoft/laravel-cas
复制的。感谢 Sentrasoft 的小伙们!
用法
1) 将此包要求在 Bookstack 根目录中
composer require spacecoyotte/bookstack-cas:dev-master
2) 在你的 app/Config/app.php
的 providers
数组中添加 SpaceCoyotte\Cas\CasServiceProvider::class,
// ...
// Application Services Provides
'providers' => [
// Laravel Framework Service Providers...
Illuminate\Auth\AuthServiceProvider::class,
// ...
BookStack\Providers\CustomFacadeProvider::class,
// Contributed Service Providers
SpaceCoyotte\Cas\CasServiceProvider::class,
],
// ...
3) 发布供应商的资产
php artisan vendor:publish
4) 编辑 app/Config/cas.php
以匹配你的要求
5) 编辑 app/Http/Kernel.php
文件以添加 cas.auth
中间件组
// ...
protected $routeMiddleware = [
// ...
'auth.cas' => \SpaceCoyotte\Cas\Middleware\CASAuthenticate::class,
// ...
];
// ...
6) 在你的 routes/web.php
文件中将 auth
中间件替换为 auth.cas
/// ...
// Authenticated routes...
Route::group(['middleware' => 'cas.auth'], function () {
/// ...
7) 就这么简单!