New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

cblink/laravel-sso

1,813 122

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 advised

Not 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
Maintainer: hanson

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

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

670,032,257 9,703
laravel/framework

The Laravel Framework.

640,572,096 35,338
laravel/tinker

Powerful REPL for the Laravel framework.

546,909,908 7,440
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

465,816,364 607
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

431,187,642 4,660

Version History

Version Released License
1.0.1 MIT
1.0.0 MIT