ecphp / laravel-cas
A bundle for Laravel, providing authentication against a Central Authentication Service (CAS) server.
1.1.0
2024-11-12 13:44 UTC
Requires
- php: >= 8.1
- ext-dom: *
- ext-simplexml: *
- ecphp/cas-lib: ^2.0
- laravel/framework: ^9 || ^10 || ^11
Requires (Dev)
- ecphp/php-conventions: ^1.0
- guzzlehttp/guzzle: ^7.9
- nyholm/psr7: ^1.8
- orchestra/testbench: ^8.26 || ^9.4
- phpstan/phpstan-strict-rules: ^1.6
- roave/security-advisories: dev-latest
- symfony/cache: ^6.4 || ^7.1
- symfony/psr-http-message-bridge: ^6.4 || ^7.1
Suggests
- symfony/psr-http-message-bridge: To bridge between Laravel and PSR HTTP Message
This package is auto-updated.
Last update: 2024-11-13 08:09:18 UTC
README
A CAS bundle for Laravel.
Installation
composer require ecphp/laravel-cas
config/app.php
'providers' => [
EcPhp\LaravelCas\Providers\AppServiceProvider::class,
],
config/auth.php
'guards' => [
'laravel-cas' => [
'driver' => 'laravel-cas',
'provider' => 'laravel-cas',
],
],
'providers' => [
'laravel-cas' => [
'driver' => 'laravel-cas',
],
],
app/Http/Kernel.php
protected $middlewareGroups = [
'web' => [
\EcPhp\LaravelCas\Middleware\CasAuthenticator::class
],
...
];
app/Providers/AppServiceProvider.php
<?php
declare(strict_types=1);
use Illuminate\Contracts\Foundation\Application;
use Psr\Http\Client\ClientInterface;
use GuzzleHttp\Client;
use loophp\psr17\Psr17Interface;
use Nyholm\Psr7\Factory\Psr17Factory;
use loophp\psr17\Psr17;
public function register(): void
{
$this->app->bind(
ClientInterface::class,
function(Application $app): ClientInterface {
//or whatever client you want
return new Client();
}
);
$this->app->bind(
Psr17Interface::class,
function(Application $app): Psr17Interface {
$psr17Factory = new Psr17Factory();
//or whatever psr17 you want
return new Psr17(
$psr17Factory,
$psr17Factory,
$psr17Factory,
$psr17Factory,
$psr17Factory,
$psr17Factory
);
}
);
}
php artisan vendor:publish --tag=laravel-cas