当前位置:Gxlcms > PHP教程 > ECSHOP中加入单点登录解决方案

ECSHOP中加入单点登录解决方案

时间:2021-07-01 10:21:17 帮助过:11人阅读

ECSHOP 中加入单点登录
登录系统A,系统A的首页中有一个链接跳转到ecshop,系统A已使用单点登录,是java做的。
ecshop 中加入单点登录怎么实现。对PHP 不是很了解。
网上找了一个 PHP 单点登录的例子,能实现单点登录,但是怎么整合到ecshop里面去。本人学java的,对php不懂,由于时间关系,现在去学的话时间也不够。
大家帮帮忙吧。急。 扣扣:66014588

//
// phpCAS simple client
//
// import phpCAS lib
include_once('CAS.php');

//可以不用,用于调试,可以通过服务端的cas.log看到验证过程。
phpCAS::setDebug();

// initialize phpCAS
//phpCAS::client(CAS_VERSION_2_0,'服务地址',端口号,'cas的访问地址');
phpCAS::client(CAS_VERSION_2_0,'testsso.yigewang.com.cn',80,'');

// no SSL validation for the CAS server 不使用SSL服务校验
phpCAS::setNoCasServerValidation();

// force CAS authentication
//这里会检测服务器端的退出的通知,就能实现php和其他语言平台间同步登出了
phpCAS::handleLogoutRequests();

//phpCAS::checkAuthentication();
// 访问CAS的验证
phpCAS::forceAuthentication();
// at this step, the user has been authenticated by the CAS server
// and the user's login name can be read with phpCAS::getUser().
// logout if desired

if (isset($_REQUEST['logout'])) {

$param=array("service"=>"http://localhost/phpCasClient/example_simple.php");//退出登录后返回
phpCAS::logout($param);

}
// for this test, simply print that the authentication was successfull
?>


phpCAS simple client


Successfull Authentication!这是客户端1


the user's login is .



用户名:===


===


=====


=====


=====


=====



phpCAS version is .


退出





------解决思路----------------------
你找这个例子基本上没啥用

人气教程排行