Single Sign-On package for Sobiz applications using OAuth 2.0 + OIDC
sobiz/laravel-sso is a Laravel package for single sign-on package for sobiz applications using oauth 2.0 + oidc.
It currently has 0 GitHub stars and 41 downloads on Packagist.
Install it with composer require sobiz/laravel-sso.
Discover more Laravel packages by sobiz
or browse all Laravel packages to compare alternatives.
Last updated
A lightweight Single Sign-On (SSO) package for Laravel applications, enabling seamless authentication with Sobiz MyProfile (OAuth 2.0 + OIDC).
composer require sobiz/laravel-sso
The installation command will publish the configuration file, migrations, and views. It will also add the necessary environment variables to your .env file.
php artisan sso:install
Go to Sobiz MyProfile Admin and register your application to get your Client ID and Client Secret.
Ensure the following variables are correctly set in your .env file:
SSO_AUTH_SERVER_URL=https://myprofile.sobiz.com
SSO_CLIENT_ID=your-client-id
SSO_CLIENT_SECRET=your-client-secret
SSO_REDIRECT_URI=https://your-app.com/auth/sso/callback
SSO_SESSION_DOMAIN=your-app-domain.com
Protect your routes using the sso.auth middleware:
Route::middleware(['sso.auth'])->group(function () {
Route::get('/dashboard', [DashboardController::class, 'index']);
});
Add the pre-styled SSO login button to your login page:
@include('sso::login-button')
You can use the SSO facade to access user information or handle logout:
use Sobiz\LaravelSSO\Facades\SSO;
// Get the authenticated SSO user
$user = SSO::user();
// Logout
SSO::logout();
To remove the package resources (config, views, migrations, and environment variables) from your application, run:
php artisan sso:uninstall
[!WARNING] This command will delete published files and remove SSO variables from your
.env. If you have already run migrations, remember to roll them back manually before running this command if you wish to remove the database tables.
After running the uninstall command, you can remove the package from composer:
composer remove sobiz/laravel-sso
SESSION_DOMAIN in .env matches the domain you are visiting, and that your APP_URL matches your actual serving URL (including port if on localhost).SSO_REDIRECT_URI is correctly registered in both your application .env and the MyProfile admin portal.The MIT License (MIT). Please see License File for more information.