ctbuh / laravel-auth-sso
universal login provider
v0.8.6
2019-10-19 05:00 UTC
Requires
- illuminate/contracts: ^5.7|^6.0
Requires (Dev)
- orchestra/testbench: ^4.2
- phpunit/phpunit: ^8.4
This package is not auto-updated.
Last update: 2024-12-11 05:28:42 UTC
README
Install
composer require ctbuh/laravel-auth-sso
Usage
Add 'sso' guard to config/auth.php
'sso' => [ 'driver' => 'sso', 'provider' => null ]
Add this to config/app.php
ctbuh\Login\LoginServiceProvider::class
Make sure SESSION_DOMAIN= is set to primary domain.
Reload all config
php artisan config:cache
Use from within your controller or as middleware:
Route::middleware('auth:sso')->group(function () { Route::get('whoami', function(){ $user = auth()->guard('sso')->user(); return $user->getFirstName(); }); });
Route list
- /sso/login - Send person to login page.
- /sso/callback?access_token={token} -- If successful, person will be sent to this page.
- /sso/logout --- Revoke cookie & token itself.