pangodream / alisign-socialite
Socialite driver to connect Alisign SSO Server
Installs: 2
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/pangodream/alisign-socialite
Requires
- php: ^8.2
- illuminate/support: ^10.0|^11.0
- laravel/socialite: ^5.23
- socialiteproviders/manager: ^4.8
README
Socialite driver to perform Single Sign On using an Alisign SSO Server
Installation
Package
my-laravel-project>composer require pangodream/alisign-socialite
Files
php artisan alisign-socialite:install
Installing Alisign Socialite driver ...
→ Copied my-laravel-project\routes/alisign.php
→ Copied my-laravel-project\app\Providers/SSOServiceProvider.php
→ Copied my-laravel-project\app\Http/Middleware/CheckSSOStatus.php
→ Added reference to routes/alisign.php
→ laravel-sso configuration added to config/services.php
→ App\\Providers\\SSOServiceProvider added to bootstrap/app.php
Alisign Socialite driver succesfully installed ✅
Configuration
Add server details in .env file
SSO_BASE_URL=https://alisign.xxxxxxx.xxx
SSO_CLIENT_ID=xxxxxxxxxxxxxxxxxxxx
SSO_CLIENT_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxx
SSO_REDIRECT_URI=${APP_URL}/oauth/callback
Use
Login
Invoke route /auth/redirect from any point of your aplication
For instance, append to your breeze login template the following snippet
<div class="flex items-center justify-end mt-4">
<a href="{{env('APP_URL')}}/auth/redirect">SSO Login</a>
</div>
Logout
Use the logout Breeze route (no changes at this point)
<form action="/logout" method="POST">
@csrf
<button type="submit">Cerrar sesión</button>
</form>
Renew session time if server session is alive
Add the SSOCheckStatus middleware to those routes you need to check if server session is still alive or you need to cancel local session.
For instance, the following routes under the group check the local session but also the SSO Server session
Route::group(['middleware' => ['auth', \App\Http\Middleware\CheckSSOStatus::class]], function () {
Route::get('/dashboard', [\App\Http\Controllers\DashboardController::class, 'show'])->name('dashboard');
});