PHP Classes
elePHPant
Icontem

Pure PHP radius class: Authenticate users with a RADIUS server

Recommend this page to a friend!
  Info   View files View files (8)   DownloadInstall with Composer Download .zip   Reputation   Support forum (6)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2009-01-05 (8 years ago) RSS 2.0 feedStarStarStarStar 75%Total: 2,013 All time: 1,909 This week: 624Up
Version License PHP version Categories
radius_class 1.2GNU Lesser Genera...4.0.7Networking, User Management
Description Author

This class can be used to authenticate users with a RADIUS network access server according to RFC 2865.

It connects to a Radius server given its IP address and requests access on behalf of an user given his password.

Once authenticated the class may return the attributes of the authorized user.

This class works with at least the following RADIUS servers:

- Authenex Strong Authentication System (ASAS) with two-factor authentication
- FreeRADIUS, a free Radius server implementation for Linux and Unix environments
- Microsoft Radius server IAS
- Radl, a free Radius server for Windows
- RSA SecurID (challenge/response support for the New-PIN mode)
- WinRadius, Windows Radius server (free for 5 users)
- ZyXEL ZyWALL OTP (One-Time Password for Two-Factor Authentication, Authenex ASAS branded by ZyXEL)

Innovation Award
PHP Programming Innovation award nominee
January 2008
Number 2


Prize: One copy of DWebPro Standard License
Radius is a protocol often used for enabling network access to ISP clients upon authentication.

This class is a pure PHP implementation of Radius protocol client.

It can be used to authenticate and grant users the access to Web resources served by PHP using the same user names and passwords that ISP clients use to have network access.

Manuel Lemos
  Performance   Level  
Name: André Liechti <contact>
Classes: 8 packages by
Country: Switzerland Switzerland
Age: 48
All time rank: 4637 in Switzerland Switzerland
Week rank: 519 Down5 in Switzerland Switzerland Up
Innovation award
Innovation award
Nominee: 7x

Winner: 2x

Details
Pure PHP radius class

Last update: 2009-01-05, release 1.2.2

This Radius class is a radius client implementation in pure PHP
following the RFC 2865 rules (http://www.ietf.org/rfc/rfc2865.txt)


This class works with at least the following RADIUS servers:
 - Authenex Strong Authentication System (ASAS) with two-factor authentication
 - FreeRADIUS, a free Radius server implementation for Linux and *nix environments
 - Microsoft Radius server IAS
 - Mideye RADIUS server (http://www.mideye.com)
 - Radl, a free Radius server for Windows
 - RSA SecurID
 - VASCO Middleware 3.0 server
 - WinRadius, Windows Radius server (free for 5 users)
 - ZyXEL ZyWALL OTP (Authenex ASAS branded by ZyXEL, cheaper)
 


USAGE

require_once('radius.class.php');
$radius = new Radius($ip_radius_server = 'radius_server_ip_address', $shared_secret = 'radius_shared_secret'[, $radius_suffix = 'optional_radius_suffix'[, $udp_timeout = udp_timeout_in_seconds[, $authentication_port = 1812]]]);
$result = $radius->Access_Request($username = 'username', $password = 'password'[, $udp_timeout = udp_timeout_in_seconds]);



EXAMPLES

Example 1
    require_once('radius.class.php');
    $radius = new Radius('127.0.0.1', 'secret');
    $radius->SetNasIpAddress('1.2.3.4'); // Needed for some devices (not always auto-detected)
    if ($radius->AccessRequest('user', 'pass'))
    {
        echo "Authentication accepted.";
    }
    else
    {
        echo "Authentication rejected.";
    }


Example 2
    require_once('radius.class.php');
    $radius = new Radius('127.0.0.1', 'secret');
    $radius->SetNasPort(0);
    $radius->SetNasIpAddress('1.2.3.4'); // Needed for some devices (not always auto-detected)
    if ($radius->AccessRequest('user', 'pass'))
    {
        echo "Authentication accepted.";
        echo "<br />";
    }
    else
    {
        echo "Authentication rejected.";
        echo "<br />";
    }
    echo $radius->GetReadableReceivedAttributes();



LICENCE

Copyright (c) 2008, SysCo systemes de communication sa
SysCo (tm) is a trademark of SysCo systemes de communication sa
(http://www.sysco.ch/)
All rights reserved.

Pure PHP radius class is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of the License,
or (at your option) any later version.

Pure PHP radius class is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with Pure PHP radius class.
If not, see <http://www.gnu.org/licenses/>.
  Files folder image Files  
File Role Description
Plain text file radius.class.php Class Main file, class definition
Accessible without login Plain text file radius.www.authenticate.php Appl. Additional file to implement WWW Authentication using a Radius server
Accessible without login Plain text file radius.demo.php Example Demo file for regular usage
Accessible without login Plain text file radius.demo.www.authenticate.php Example Demo of a WWW Authentication using a Radius server
Accessible without login Plain text file radius.challenge.response.demo.php Example Challenge/response demo file
Accessible without login Plain text file README.TXT Doc. README FILE
Accessible without login Plain text file COPYING.LESSER Lic. LGPL Version 3.0
Accessible without login Plain text file COPYING Lic. GPL Version 3.0

 Version Control Unique User Downloads Download Rankings  
 0%
Total:2,013
This week:0
All time:1,909
This week:624Up
User Ratings User Comments (2)
 All time
Utility:100%StarStarStarStarStarStar
Consistency:92%StarStarStarStarStar
Documentation:75%StarStarStarStar
Examples:89%StarStarStarStarStar
Tests:-
Videos:-
Overall:75%StarStarStarStar
Rank:110
 
This was a great example, and as of 10/21/2015 this still is ...
1 year ago (David Kittell)
80%StarStarStarStarStar
saves me hours!
5 years ago (Thomas Ehrhardt)
80%StarStarStarStarStar