flexcoders / opauth-radius
Opauth的Radius认证策略
dev-master
2015-06-27 16:16 UTC
Requires
- php: >=5.2.0
- opauth/opauth: >=0.2.0
This package is auto-updated.
Last update: 2024-09-04 23:44:46 UTC
README
Opauth的Radius认证策略。
Opauth是PHP的一个多提供商认证框架。
入门指南
-
安装Opauth-Radius
cd path_to_opauth/Strategy git clone git://github.com/flexcoders/opauth-radius.git radius
-
配置Opauth-Radius策略。
-
调用它。
由于这不是基于HTTP的协议,一些标准的Opauth配置不适用。没有涉及重定向,需要传递用户名和密码。
调用方式如下
// some input vars
$providerName = "Radius";
// prep a config
$config = [
'provider' => $providerName,
'username' => $_POST['username'],
'password' => $_POST['password'],
'request_uri' => '/current/uri/'.strtolower($providerName),
'callback_url' => '/your/uri/for/callback/'.strtolower($providerName),
];
// construct the Opauth object
$this->opauth = new \Opauth($config, true);
它将尝试Radius登录,然后重定向到回调URL,就像所有其他Opauth策略一样,并返回类似响应。
策略配置
必需参数
<?php 'Radius' => array( 'server' => '127.0.0.1', 'secret' => 'testing123', 'port' => 1812, 'acctport' => 1813, 'nasip' => '1.2.3.4', 'level' => 10, 'higher' => 6, 'lower' => 2, 'expiry' => 86400, )
可选参数:level
,higher
,lower
,expiry
支持思科的AVPair "shell:priv-lvl"
尽管这并非认证过程的一部分,但这个库支持思科的shell权限级别,这在许多大型组织中用于允许不同级别的管理员访问。
它允许你定义一个阈值level
。如果权限级别大于或等于定义的值,则返回higher
值,并在$\this->auth['info']['group_id']中返回,如果级别较低,则返回lower
值。
这将允许Opauth实现创建用户账户,用户在首次登录时即可使用,因为应用程序中所需的一组权限已经已知。
许可证
Opauth-Radius采用MIT许可证,版权所有 © 2015 FlexCoders Ltd (http://flexcoders.co.uk)