查看“单点登录”的源代码
←
单点登录
跳转至:
导航
、
搜索
因为以下原因,你没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看并复制此页面的源代码:
=相关收藏= * [http://www.coin163.com/java/docs/201309/d_2830028902.html SSO实现机制:Cookie机制和Session机制] =Laravel单点登入原型= ==站点结构== * laravel.example.com 认证服务器。 * thinkphp.example.com 采用session共享方式实现单点登录。 * [a|b|c|d].example.com 客户端。 ==配置Laravel oauth2服务器== https://github.com/lucadegasperi/oauth2-server-laravel 按文档给lumen添加oauth2很顺利,没有意外发生。 1、获取oauth2组件 <source lang='bash'> #composer.json "lucadegasperi/oauth2-server-laravel": "5.1.*" composer update </source> 2、配置oauth2 <source lang='php'> //config/app.php LucaDegasperi\OAuth2Server\Storage\FluentStorageServiceProvider::class, LucaDegasperi\OAuth2Server\OAuth2ServerServiceProvider::class, //Add this line to the aliases array: 'Authorizer' => LucaDegasperi\OAuth2Server\Facades\Authorizer::class, //app/Http/Kernel.php file in the $middleware array \LucaDegasperi\OAuth2Server\Middleware\OAuthExceptionHandlerMiddleware::class, //Then add below to the $routeMiddleware array. 'oauth' => \LucaDegasperi\OAuth2Server\Middleware\OAuthMiddleware::class, 'oauth-user' => \LucaDegasperi\OAuth2Server\Middleware\OAuthUserOwnerMiddleware::class, 'oauth-client' => \LucaDegasperi\OAuth2Server\Middleware\OAuthClientOwnerMiddleware::class, 'check-authorization-params' => \LucaDegasperi\OAuth2Server\Middleware\CheckAuthCodeRequestMiddleware::class, //XX: In order to make some the authorization and resource server work correctly with Laravel5, remove the App\Http\Middleware\VerifyCsrfToken line from the $middleware array and place it in the $routeMiddleware array like this: 'csrf' => App\Http\Middleware\VerifyCsrfToken::class, </source> 3、配置数据库 <source lang='bash'> php artisan vendor:publish php artisan migrate </source> ==配置Laravel oauth2客户端== 相对服务端的配置,客户端的配置真是太简单了,只要一条composer命令即可。 <source lang='bash'> $ composer require league/oauth2-client </source> =CAS= https://www.apereo.org/projects/cas CAS官网 http://blog.chinaunix.net/uid-22816738-id-3525939.html CAS+SSO原理浅谈 http://www.ibm.com/developerworks/cn/opensource/os-cn-cas/index.html 使用 CAS 在 Tomcat 中实现单点登录 http://www.cnblogs.com/zhenyulu/archive/2013/01/22/2870838.html Yale CAS + .net Client 实现 SSO http://hybridauth.sourceforge.net HybridAuth =Laravel与ThinkPHP共享SESSION实现单点登录= # 把Laravel的session存入数据库 # 把ThinkPHP的session存入数据库 # 修改ThinkPHP的session.save_hander为自定义数据库,修改session读写驱动按Laravel格式读取、存储SESSION数据。 # 设置Laravel、ThinkPHP使用相同的session.name、session.cookie_domain。 # 结束 =OAuth 2.0= 传统密码授权的缺陷: #"云冲印"为了后续的服务,会保存用户的密码,这样很不安全。 #Google不得不部署密码登录,而我们知道,单纯的密码登录并不安全。 #"云冲印"拥有了获取用户储存在Google所有资料的权力,用户没法限制"云冲印"获得授权的范围和有效期。 #用户只有修改密码,才能收回赋予"云冲印"的权力。但是这样做,会使得其他所有获得用户授权的第三方应用程序全部失效。 #只要有一个第三方应用程序被破解,就会导致用户密码泄漏,以及所有被密码保护的数据泄漏。 OAuth 2.0定义了四种授权方式。 #授权码模式(authorization code):复杂,token由授权服务器直接发给客户端。 #简化模式(implicit):复杂,token在浏览器上算出。 #密码模式(resource owner password credentials):简单,客户端不得存储用户的密码。 #客户端模式(client credentials):对客户端的授权,也就是无授权。 http://www.ruanyifeng.com/blog/2014/05/oauth_2_0.html 阮一峰对oauth2的介绍。 =JSONP= http://www.cnblogs.com/qiongmiaoer/archive/2013/03/17/2964822.html https://www.wuchengkai.com/principle/ http://www.travisup.com/post/index/28 =JWT= http://blog.leapoahead.com/2015/09/06/understanding-jwt/ JSON Web Token - 在Web应用间安全地传递信息
返回
单点登录
。
导航菜单
个人工具
登录
命名空间
页面
讨论
变种
视图
阅读
查看源代码
查看历史
更多
搜索
导航
首页
最近更改
随机页面
帮助
工具
链入页面
相关更改
特殊页面
页面信息