Package Data | |
---|---|
Maintainer Username: | zhoufanqq |
Maintainer Contact: | zhoufanqq@126.com (:zhoufan) |
Package Create Date: | 2016-06-24 |
Package Last Update: | 2016-06-24 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2025-02-09 15:11:45 |
Package Statistics | |
---|---|
Total Downloads: | 45 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 5 |
Total Watchers: | 2 |
Total Forks: | 2 |
Total Open Issues: | 1 |
适用于 Laravel 5 的 sso单点登录客户端。
Via Composer
``` bash
$ composer require zhoufanqq/sso-client
```
config/app.php
配置项中。'providers' => [
/*
* 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,
],
config/app.php
配置项中。'aliases' => [
'View' => Illuminate\Support\Facades\View::class,
'Curl' => Ixudra\Curl\Facades\Curl::class,
// ...
'ssoClient' => zhoufanqq\ssoClient\Facades\ssoClient::class,
],
*暂时使用redis保存信息,使用名为Redisp
*默认sso异步通知URI为:
/sso-client/check
-添加拦截中间件
``` 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);
}
```
判断用户是否登录,返回true or false
sso中心授权成功后,sso客户端根据返回的ticket判断用户是否登录。返回true or false
返回用户信息