2017 © Pedro Peláez
 

library sso-client

单点登录客户端(laravel版)

image

zhoufanqq/sso-client

单点登录客户端(laravel版)

  • Friday, June 24, 2016
  • by zhoufanqq
  • Repository
  • 1 Watchers
  • 4 Stars
  • 11 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 2 Versions
  • 10 % Grown

The README.md

Laravel, (*1)

适用于 Laravel 5 的 sso单点登录客户端。, (*2)

Getting Started

安装

Via Composer

``` bash
$ composer require zhoufanqq/sso-client
```

添加 Provider 到 config/app.php 配置项中。

```php 'providers' => [, (*3)

/*
 * Application Service Providers...
 */
   App\Providers\AppServiceProvider::class,
   App\Providers\AuthServiceProvider::class,
   App\Providers\EventServiceProvider::class,
   App\Providers\RouteServiceProvider::class,
// ...

// 添加 FIS 的 Provider
zhoufanqq\ssoClient\ssoClientServiceProvider::class,

],, (*4)

```, (*5)

如果你想更直接的使用 FIS Facades 的话,请添加 aliases。同样是 config/app.php 配置项中。

```php 'aliases' => [, (*6)

'View' => Illuminate\Support\Facades\View::class,
'Curl' => Ixudra\Curl\Facades\Curl::class,

// ...


'ssoClient' => zhoufanqq\ssoClient\Facades\ssoClient::class,

], ```, (*7)

重要事项

*暂时使用redis保存信息,使用名为Redisp *默认sso异步通知URI为: /sso-client/check, (*8)

使用

-添加拦截中间件, (*9)

 ``` php
 use ssoClient;

    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        if (!ssoClient::isLogin()) {
            return redirect('login-path');
        }
        return $next($request);
    }
 ```

函数

#### isLogin() 判断用户是否登录,返回true or false, (*10)

#### check(Request $request) sso中心授权成功后,sso客户端根据返回的ticket判断用户是否登录。返回true or false, (*11)

#### getUserInfo() 返回用户信息, (*12)

## Change Log, (*13)

### 2015/07/13 发布 1.0 版本, (*14)

The Versions

24/06 2016

dev-master

9999999-dev https://github.com/zhoufanqq/ssoClient

单点登录客户端(laravel版)

  Sources   Download

MIT

The Requires

 

The Development Requires

zhoufanqq ssoclient

24/06 2016

0.0.1

0.0.1.0 https://github.com/zhoufanqq/ssoClient

单点登录客户端(laravel版)

  Sources   Download

MIT

The Requires

 

The Development Requires

zhoufanqq ssoclient