uazgraduatecollege/cakephp-casauth
最新稳定版本:2.0.0
Composer 安装命令:
composer require uazgraduatecollege/cakephp-casauth
包简介
CAS Authentication wrapper for CakePHP 4.x using Apereo (formerly Jasig) phpCAS
README 文档
README
Very basic CAS Authentication for CakePHP 4.
Installing via composer
Install into your project using composer. For existing applications you can add the following to your composer.json file:
"repositories": [ { "type": "git", "url": "https://github.com/uazgraduatecollege/cakephp-casauth.git" } ], "require": { "uazgraduatecollege/cakephp-casauth": "~2.0" }
And run php composer.phar update
Usage
Load the Cake AuthComponent, including CasAuth.Cas as an authenticator. For example:
$this->loadComponent('Auth'); $this->Auth->config( 'authenticate', [ 'CasAuth.Cas' => [ 'cas_host => 'cas.mydomain.com', 'cas_context => '/cas, 'client_service_name => 'https://clientapplication.otherdomain.com', ] ] );
Or combine the load and configuration into one step:
$this->loadComponent( 'Auth', [ 'authenticate' => [ 'CasAuth.Cas' => [ 'cas_host => 'cas.mydomain.com', 'cas_context => '/cas, 'client_service_name => 'https://clientapplication.otherdomain.com', ] ] ] );
Parameters
- cas_host is required.
- cas_context defaults to '' (an empty string)
- client_service_name (optional) defaults to
$_SERVER['SERVER_NAME'] - cas_port defaults to 443
- debug (optional) if true, then phpCAS will write debug info to your configured logger.
- cert_path (optional) if set, then phpCAS will use the specified CA certificate file to verify the CAS server
- curlopts (optional) key/value paired array of additional CURL parameters to pass through to phpCAS::setExtraCurlOption, e.g.
'curlopts' => [CURLOPT_PROXY => 'http://proxy:5543', CURLOPT_CRLF => true]
Note about parameter key changes
Prior to release 2.0.0, several parameter used different keys.
Release 2.0.0 updates apereo/phpcas to use at least version 1.6, which contains breaking changes.
For better clarity, the previous parameter key names have been re-mapped to the new names, which
match variable names as used in the apereo/phpcas
example client usage.
hostnamechanged tocas_hostportchanged tocas_porturichanged tocas_context
cakephp-casauth looks for input parameters using the old keys to try to remain backwards compatible. Your mileage may vary.
License
This project was forked from Glen Sawyer's cakephp-3-cas repository and retains the original Apache License version 2.0.
统计信息
- 总下载量: 377
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-12-13