cblink/laravel-sso
Larablocks Analysis
cblink/laravel-sso works with any PHP project: the latest release (1.0.1, Aug 15, 2018) doesn't depend on Laravel.
Recommendation checks
Not advisedNot advised: no release or commit in over 2 years.
- No release or commit in over 2 years
- No release in the last 12 months (last: Aug 15, 2018)
- 20 downloads a month (needs 10,000)
- 122 GitHub stars (at least 100)
State
Likely abandoned- No release or commit in over 2 years.
- Last stable release: Aug 15, 2018.
- No releases in the last 12 months.
- First released: Aug 1, 2018.
- Monthly downloads: 20.
- 1 open issue on GitHub.
Data from Packagist and GitHub, checked by Larablocks on Nov 29, 2026.
| Install | |
|---|---|
composer require cblink/laravel-sso |
|
| Latest Version: | 1.0.1 |
| License: | MIT |
| Last Updated: | Aug 15, 2018 |
| Links: | GitHub · Packagist |
laravel-sso
install
composer require cblink/laravel-sso -vvv
configure
publish config.php and migration
php artisan vendor:publish --provider="Cblink\Sso\SsoServiceProvider"
migrate:
php artisan migrate
this command will create a table name sso to authorize.
create sso route:
php artisan sso:route
also you can create sso through command
php artisan sso:create
add to your auth.php:
'guards' => [
'sso' => [
'driver' => 'session',
'provider' => 'sso',
],
],
'providers' => [
'sso' => [
'driver' => 'sso',
'table' => 'sso',
],
],
usage
Get ticket in client
// sso client system
Route::get('sso', function () {
$client = new \GuzzleHttp\Client();
$response = $client->get('http://yourdomain/sso/getTicket?'.http_build_query([
'app_id' => 'your_app_id',
'secret' => 'your_secret',
]));
$result = json_decode((string)$response->getBody(), true);
if ($ticket = $result['ticket'] ?? null) {
return redirect('http://yourdomain/sso/login?ticket='.$ticket);
}
});
Redirect to any url
add middleware to Http/kernel.php
protected $routeMiddleware = [
// ...
'ticket' => \Cblink\Sso\Http\Middleware\LoginWithTicket::class,
];
// declare route priority
protected $middlewarePriority = [
\Illuminate\Session\Middleware\StartSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\Cblink\Sso\Http\Middleware\LoginWithTicket::class,
\Illuminate\Auth\Middleware\Authenticate::class,
\Illuminate\Session\Middleware\AuthenticateSession::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
\Illuminate\Auth\Middleware\Authorize::class,
];
in web.php , add ticket before auth:
Route::group(['middleware' => ['ticket', 'auth'], function () {
// ...
});
Related Packages
Powerful PHP database abstraction layer (DBAL) with many features for database s...
Laravel Serializable Closure provides an easy and secure way to serialize closur...
Cli error handling for console/command-line PHP applications.
Version History
| Version | Released | License |
|---|---|---|
| 1.0.1 | MIT | |
| 1.0.0 | MIT |