PHPackages                             zhimei/sso - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. zhimei/sso

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

zhimei/sso
==========

SSO authentication to Laravel 5 and Lumen

v0.1(10y ago)176646MITPHPPHP &gt;=5.5.0

Since Mar 22Pushed 10y ago4 watchersCompare

[ Source](https://github.com/zhimeilee/sso)[ Packagist](https://packagist.org/packages/zhimei/sso)[ RSS](/packages/zhimei-sso/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

SSO Server
==========

[](#sso-server)

SSO server SSO authentication in Laravel 5.x &amp; Lumen

### Installation

[](#installation)

Require this package in your composer.json and run composer update.

```
    "Zhimei/sso": "dev-master"

```

\####For Laravel 5: After updating composer, add the ServiceProvider to the providers array in config/app.php

```
    Zhimei\sso\SsoServerServiceProvider::class
```

As well as the Facade :

```
    'SsoServer' => 'Zhimei\sso\Facades\SsoServer'
```

Then publish the package's config using one of those methods :

```
    $ php artisan config:publish Zhimei/sso

```

After publishing config, please config the items in your config/sso.php

```
    'sso_server' => [
                'model'         => env('SSO_MODEL'),  //It's abstract of Zhimei\sso\SsoServerModeAbstract
                'driver'        => env('SSO_SERVER_DRIVER', 'file'),  //file or memcached (recommend memcached)
                'clients'       => [
                    //'app_id'              => ['app_id'=>'app_id', 'app_secret'=>'app_secret', 'return_url'=>'return_url'],
                    'app_id_client_www'     => ['app_id'=>'app_id_client_www', 'app_secret'=>'app_secret_24A234FDG34S54GS', 'return_url'=>'http://www.zhimei360.com/'],
                    //...
                ],

            ],
```

\####For Lumen : After updating composer, register ServiceProvider in bootstrap/app.php

```
    $app->register(Zhimei\sso\SsoServerServiceProvider::class);
```

configure in .env

```
     SSO_MODEL=App\Models\SsoUser  ####It's abstract of Zhimei\sso\SsoServerModeAbstract
     SSO_SERVER_DRIVER=file
     SSO_CLIENT_APP_ID_1=app_id_1
     SSO_CLIENT_APP_SECRET_1=asdfsdfdf34rfdfE
     SSO_CLIENT_APP_RETURN_URL_1=http://sso/
    # SSO_CLIENT_APP_ID_2=
    # SSO_CLIENT_APP_SECRET_2=
    # SSO_CLIENT_APP_RETURN_URL_2=
    # SSO_CLIENT_APP_ID_3=
    # SSO_CLIENT_APP_SECRET_3=
    # SSO_CLIENT_APP_RETURN_URL_3=
```

\####For Both: App\\Models\\SsoUser

```
