fzipi/zf2-radius-authentication-adapter
最新稳定版本:0.1.2
Composer 安装命令:
composer require fzipi/zf2-radius-authentication-adapter
包简介
RADIUS authentication adapter for Zend Framework 2
README 文档
README
Forked originally from MT4SoftwareStudio/orbini-auth-radius (for zf1). Added functionality for Radius realms.
Requirements
- Zend Framework 2 Authentication framework
- PHP PECL Radius extension
Installation
Add this repository to your composer.json:
{
"require": {
"fzipi/zf2-radius-authentication-adapter": "~0.0"
}
}
then composer update.
Usage
<?php use Fing\Authentication\Adapter\Radius as RadiusAdapter; use Zend\Authentication; $servers = array( 'realm' => "myrealm", 'servers' => array( array( 'hostname' => 'radius01.example.com', 'port' => 1812, 'secret' => '<verysecretstringforthisserver>', ), array( 'hostname' => 'radius02.example.com', 'port' => 18120, // not default port 'secret' => '<anotherverysecretstring>', 'timeout' => 10, 'maxTries' => 2 ) ) ); //Create our adapter passing one server (up to 10 can be passed) $adapter = new RadiusAdapter($options, $username, $password); //Authenticate $result = $adapter->authenticate(); //Using Radius REALMS $adapter->setRealm("routers"); // if not set in options config previously $access = $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
Did you remember to set your RADIUS secret accordingly?
统计信息
- 总下载量: 29
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-11-07