PHP code example of nddcoder / laravel-sso

1. Go to this page and download the library: Download nddcoder/laravel-sso library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

nddcoder / laravel-sso example snippets


'api' => [
    'throttle:60,1',
    'bindings',
],

'sso' => [
    \App\Http\Middleware\EncryptCookies::class,
    \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
    \Illuminate\Session\Middleware\StartSession::class,
    'bindings',
],

//...

protected $routeMiddleware = [
    'auto_login' => \Nddcoder\LaravelSSO\Middleware\SSOAutoLogin::class,
    //...
];

protected function attemptLogin(Request $request)
{
    $broker = new \Nddcoder\LaravelSSO\LaravelSSOBroker;
    
    $credentials = $this->credentials($request);
    return $broker->login($credentials[$this->username()], $credentials['password']);
}

public function logout(Request $request)
{
    $broker = new \Nddcoder\LaravelSSO\LaravelSSOBroker;
    
    $broker->logout();
    
    $this->guard()->logout();
    
    $request->session()->invalidate();
    
    return redirect('/');
}
shell
$ php artisan vendor:publish --provider="Nddcoder\LaravelSSO\SSOServiceProvider"
shell
$ php artisan migrate --path=vendor/nddcoder/laravel-sso/database/migrations
shell
$ php artisan sso:broker:create {name}
shell
$ php artisan vendor:publish --provider="Nddcoder\LaravelSSO\SSOServiceProvider"