mehr-als-nix/zf2-saml
Composer 安装命令:
composer require mehr-als-nix/zf2-saml
包简介
SAML Authentication module for ZF-2.
README 文档
README
SAML authentication module for ZF2.
This module uses onelogin/php-saml internally and wrap the function in services.
Installation
Just require mehr-als-nix/zf-saml in your composer.json.
Enable it in application.config.php
'modules' => array (
// ---8<---
'ZF\ApiProblem',
'ZF\ContentNegotiation',
'MehrAlsNix\ZF\SAML',
// --->8---
),
Configuration
Copy saml.local.php.dist to config/autoload/saml.local.php
Services
MehrAlsNix\ZF\SAML\Service\SAML2Auth
Provides an instance of OneLogin_Saml2_Auth
MehrAlsNix\ZF\SAML\Service\SAML2AuthnRequest
Provides an instance of OneLogin_Saml2_AuthnRequest
MehrAlsNix\ZF\SAML\Service\SAML2Metadata
Provides an instance of OneLogin_Saml2_Metadata
MehrAlsNix\ZF\SAML\Service\SAML2Response
Provides an instance of OneLogin_Saml2_Response
MehrAlsNix\ZF\SAML\Service\SAML2Settings
Provides an instance of OneLogin_Saml2_Settings
API protection
Assume $this->samlAuth contains an instance of OneLogin_Saml2_Auth, then
you would be able to protect your API.
if (!$this->samlAuth->isAuthenticated()) {
$this->getResponse()->setStatusCode(401);
return;
}
统计信息
- 总下载量: 60
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-10-25