Home  >  Article  >  Backend Development  >  ECSHOP 中加入单点登录解决方案

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

WBOY
WBOYOriginal
2016-06-13 12:27:371056browse

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

<br /><?php<br />//<br />// phpCAS simple client<br />//<br />// import phpCAS lib<br />include_once('CAS.php');<br /><br />//可以不用,用于调试,可以通过服务端的cas.log看到验证过程。<br />phpCAS::setDebug();<br /><br />// initialize phpCAS<br />//phpCAS::client(CAS_VERSION_2_0,'服务地址',端口号,'cas的访问地址');<br />phpCAS::client(CAS_VERSION_2_0,'testsso.yigewang.com.cn',80,'');<br /><br />// no SSL validation for the CAS server	不使用SSL服务校验<br />phpCAS::setNoCasServerValidation();<br /><br />// force CAS authentication<br />//这里会检测服务器端的退出的通知,就能实现php和其他语言平台间同步登出了<br />phpCAS::handleLogoutRequests();<br /><br />//phpCAS::checkAuthentication();<br />// 访问CAS的验证<br />phpCAS::forceAuthentication();<br />// at this step, the user has been authenticated by the CAS server<br />// and the user's login name can be read with phpCAS::getUser().<br />// logout if desired<br /><br />if (isset($_REQUEST['logout'])) {<br /> <br /> $param=array("service"=>"http://localhost/phpCasClient/example_simple.php");//退出登录后返回<br /> phpCAS::logout($param);<br /><br />}<br />// for this test, simply print that the authentication was successfull<br />?><br /><html><br />  <head><br />    <title>phpCAS simple client</title><br />  </head><br />  <body><br />    <h1>Successfull Authentication!这是客户端1</h1><br />    <p>the user's login is <b><?php echo phpCAS::getUser(); ?></b>.</p><br /><br />	<p>用户名:<?php echo phpCAS::getAttribute('USER_NAME'); ?>===</p><br />	<p><?php echo phpCAS::getAttribute('ORG_CODE'); ?>===</p><br />	<p>==<?php echo phpCAS::getAttribute('PER_CODE'); ?>===</p><br />	<p>==<?php echo phpCAS::getAttribute('EMAIL'); ?>===</p><br />	<p>==<?php echo phpCAS::getAttribute('MOBILE_NO'); ?>===</p><br />	<p>==<?php echo phpCAS::getAttribute('HEAD_PIC'); ?>===</p><br /><br />    <p>phpCAS version is <b><?php echo phpCAS::getVersion(); ?></b>.</p><br />     <p><a href="?logout=">退出</a></p><br />  </body><br /></html><br />

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

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn