資源簡介
php單點登陸示例源碼(sso)
代碼片段和文件信息
require_once?__DIR__?.?‘/../../vendor/autoload.php‘;
$broker?=?new?Jasny\SSO\Broker(getenv(‘SSO_SERVER‘)?getenv(‘SSO_BROKER_ID‘)?getenv(‘SSO_BROKER_SECRET‘));
if?(empty($_REQUEST[‘command‘])?||?!method_exists($broker?$_REQUEST[‘command‘]))?{
????header(“Content-Type:?application/json“);
????header(“HTTP/1.1?400?Bad?Request“);
????echo?json_encode([‘error‘?=>?‘Command?not?specified‘]);
????return;
}
try?{
????$result?=?$broker->{$_REQUEST[‘command‘]}();
}?catch?(Exception?$e)?{
????$status?=?$e->getCode()??:?500;
????$result?=?[‘error‘?=>?$e->getMessage()];
}
//?JSONP
if?(!empty($_GET[‘callback‘]))?{
????if?(!isset($result))?$result?=?null;
????if?(!isset($status))?$status?=?isset($result)???200?:?204;
????header(‘Content-Type:?application/javascript‘);
????echo?$_GET[‘callba
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-05-09?13:51??sso-master\
?????文件?????????194??2018-05-09?13:51??sso-master\.gitignore
?????文件????????1058??2018-05-09?13:51??sso-master\LICENSE
?????文件????????5436??2018-05-09?13:51??sso-master\README.md
?????文件?????????419??2018-05-09?13:51??sso-master\codeception.yml
?????文件?????????846??2018-05-09?13:51??sso-master\composer.json
?????目錄???????????0??2018-05-09?13:51??sso-master\examples\
?????目錄???????????0??2018-05-09?13:51??sso-master\examples\ajax-broker\
?????文件????????1070??2018-05-09?13:51??sso-master\examples\ajax-broker\api.php
?????文件????????2267??2018-05-09?13:51??sso-master\examples\ajax-broker\app.js
?????文件????????2051??2018-05-09?13:51??sso-master\examples\ajax-broker\index.html
?????目錄???????????0??2018-05-09?13:51??sso-master\examples\broker\
?????文件?????????737??2018-05-09?13:51??sso-master\examples\broker\error.php
?????文件????????1289??2018-05-09?13:51??sso-master\examples\broker\index.php
?????文件????????2350??2018-05-09?13:51??sso-master\examples\broker\login.php
?????目錄???????????0??2018-05-09?13:51??sso-master\examples\server\
?????文件?????????133??2018-05-09?13:51??sso-master\examples\server\.htaccess
?????文件????????2318??2018-05-09?13:51??sso-master\examples\server\MySSOServer.php
?????文件?????????461??2018-05-09?13:51??sso-master\examples\server\index.php
?????目錄???????????0??2018-05-09?13:51??sso-master\src\
?????文件????????8212??2018-05-09?13:51??sso-master\src\Broker.php
?????文件??????????92??2018-05-09?13:51??sso-master\src\Exception.php
?????文件?????????161??2018-05-09?13:51??sso-master\src\NotAttachedException.php
?????文件???????10705??2018-05-09?13:51??sso-master\src\Server.php
?????目錄???????????0??2018-05-09?13:51??sso-master\tests\
?????文件??????????57??2018-05-09?13:51??sso-master\tests\_bootstrap.php
?????目錄???????????0??2018-05-09?13:51??sso-master\tests\_data\
?????文件??????????57??2018-05-09?13:51??sso-master\tests\_data\dump.sql
?????目錄???????????0??2018-05-09?13:51??sso-master\tests\_output\
?????文件??????????13??2018-05-09?13:51??sso-master\tests\_output\.gitignore
?????目錄???????????0??2018-05-09?13:51??sso-master\tests\_support\
............此處省略21個文件信息
評論
共有 條評論