PHP Classes
elePHPant
Icontem

Pure PHP radius class: Authenticate users with a RADIUS server

Recommend this page to a friend!
  Info   View files Example   View files View files (8)   DownloadInstall with Composer Download .zip   Reputation   Support forum (6)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2017-06-05 (4 months ago) RSS 2.0 feedStarStarStarStar 75%Total: 2,043 All time: 1,886 This week: 599Up
Version License PHP version Categories
radius_class 1.2.2GNU Lesser Genera...5.3.0Networking, 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: 4517 in Switzerland Switzerland
Week rank: 237 Up3 in Switzerland Switzerland Up
Innovation award
Innovation award
Nominee: 8x

Winner: 2x

Details

Pure PHP radius class

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

(c) 2008-2009 SysCo systemes de communication sa http://developer.sysco.ch/php/

Current build: 1.2.2 (2009-01-05)

Donate via PayPal Please consider supporting this project by making a donation via [PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&currency_code=USD&business=paypal@sysco.ch&item_name=Donation%20for%20PHP%20radius%20class%20project

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();
  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.md Doc. Documentation
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  
 100%
Total:2,043
This week:0
All time:1,886
This week:599Up
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:117
 
This was a great example, and as of 10/21/2015 this still is ...
1 year ago (David Kittell)
80%StarStarStarStarStar
saves me hours!
6 years ago (Thomas Ehrhardt)
80%StarStarStarStarStar