epierce/cas-rest-client
最新稳定版本:0.3.1
Composer 安装命令:
composer require epierce/cas-rest-client
包简介
PHP client for the CAS REST protocol.
README 文档
README
PHP client for the CAS REST protocol
System Requirements
You need:
- PHP >= 5.5.0, but the latest stable version of PHP is recommended
- Composer
Install
Install cas-rest-client using Composer.
$ composer require epierce/cas-rest-client
Example Usage
<?php use epierce\CasRestClient; require_once('vendor/autoload.php'); $client = new CasRestClient(); // Configure CAS client $client->setCasServer('https://cas.exmaple.edu'); $client->setCasRestContext('/v1/tickets'); $client->setCredentials("username", "password"); // Login and save TGT to a file $client->login('/tmp/cas_tgt.json'); // Make a webservice call $response = $client->get("https://someservice"); print_r(json_decode($response->getBody(), true)); // Make another call using the same CAS session $headers = ['User-Agent' => 'testing/1.0']; $post_params = ['param1' => 'foo', param2 => 'bar']; $response = $client->post("https://someotherservice", $headers, '', $post_params); print_r(json_decode($response->getBody(), true)); $client->logout(); ?>
统计信息
- 总下载量: 20.3k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-12-26