tillikum/zf2-cas-authentication-adapter 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

tillikum/zf2-cas-authentication-adapter

最新稳定版本:v0.1.0

Composer 安装命令:

composer require tillikum/zf2-cas-authentication-adapter

包简介

CAS authentication adapter for Zend Framework 2

README 文档

README

CAS is an authentication system originally created by Yale University to provide a trusted way for an application to authenticate a user.

http://www.jasig.org/cas/

Requirements

  • Zend Framework 2 HTTP client
  • Zend Framework 2 Authentication framework

Installation

Add this repository to your composer.json:

{
    "require": {
        "tillikum/zf2-cas-authentication-adapter": "~0.0"
    }
}

then composer update.

Usage

<?php

use Tillikum\Authentication\Adapter\Cas as CasAdapter;
use Zend\Authentication;
use Zend\Http;

$httpClient = new Http\Client();

/** Standalone **/

$adapter = new CasAdapter(
    $httpClient,
    'http://localhost/cas'
);

// You'll need to do this in response to requests to your system:
$adapter->setServiceValidateParameters(
    array(
        'service' => 'http://my/current/url',
        'ticket' => 'ST-ACME-123',
    )
);

$result = $adapter->authenticate();

/** Plugged in to Zend\Authentication **/

// Assuming we're still using the $adapter constructed above:

$authService = new Authentication\AuthenticationService(
    new Authentication\Storage\NonPersistent(),
    $adapter
);

$result = $authService->authenticate();

Troubleshooting

SSL problems when talking to a CAS server

You can pass any options you like or need to the Zend\Http\Client. One example below may be necessary to give an absolute CA path for your environment:

<?php

$httpClient = new Zend\Http\Client();
$httpClient->setOptions(
    array(
        'sslcapath' => '/etc/ssl/certs'
    )
);

// ... Pass the modified HTTP client to the adapter as usual ...

统计信息

  • 总下载量: 10.41k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 4
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0
  • 更新时间: 2013-08-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固