定制 uazgraduatecollege/cakephp-casauth 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

uazgraduatecollege/cakephp-casauth

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.

  • hostname changed to cas_host
  • port changed to cas_port
  • uri changed to cas_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.

统计信息

  • 总下载量: 597
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-12-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固