A simple pure PHP RADIUS client supporting Standard and Vendor-Specific Attributes in single file

Overview

BlockBox-Radius

A simple pure PHP RADIUS client supporting Standard and Vendor-Specific Attributes in single file

Author:

Description:

BlockBox-Radius is a simple pure PHP RADIUS client for authenticating users against a RADIUS server following the RFC 2865 rules (http://www.ietf.org/rfc/rfc2865.txt) The current branch is tested to work with the following RADIUS servers:

  • Microsoft Windows Server Network Policy Server
  • FreeRADIUS 2 and above
  • WinRadius

System Requirements:

PHP 5.x - 8.x

Installation:

Just download the release archive and extract to a location on your server. In your application, require_once 'b2radius.inc'; and then you can use the class.

Usage:

require_once('b2radius.inc');
$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:

require_once('b2radius.inc');

$radius = new Radius('127.0.0.1', 'testing123');
$radius->SetNasPort(0);
$radius->SetNasIpAddress('1.2.3.4');
$radius->SetAttribute(NAS_Identifier,'CPSwitch');

// SetVendorAttribute($vendor, $type, $case, $value);
// $case : T - Text, S - String, A - IPv4, I - Integer 32 bit unsigned value

$radius->SetVendorAttribute(2636,50,'S',"test");
// 2636 vendor juniper, 50 type Juniper-CWA-Redirect, 'S' case String, "test"

$radius->SetVendorAttribute(14823,2,'I',98);
// 14823 vendor aruba, 2 type Aruba-User-Vlan, 'I' case int32, 98

if ($radius->AccessRequest('darenyeh', 'yhdgteHi')) {
echo "Authentication accepted.\n";
} else {
echo "Authentication rejected.\n";
}
echo $radius->GetReadableReceivedAttributes();
?>

Roadmap:

  1. RADIUS Accounting
  2. RADIUS CoA Disconnect
  3. RADIUS CoA Request
You might also like...
Make your own custom cast type for Laravel model attributes

Laravel Custom Casts Make your own cast type for Laravel model attributes Laravel custom casts works similarly to Eloquent attribute casting, but with

Laravel-model-mapper - Map your model attributes to class properties with ease.
Laravel-model-mapper - Map your model attributes to class properties with ease.

Laravel Model-Property Mapper This package provides functionality to map your model attributes to local class properties with the same names. The pack

Generate previous attributes when saving Eloquent models
Generate previous attributes when saving Eloquent models

This package provides a trait that will generate previous attributes when saving any Eloquent model.

This package allows you to render livewire components like a blade component, giving it attributes, slots etc

X-livewire This package allows you to render livewire components like a blade component, giving it attributes, slots etc. Assuming you wanted to creat

Provide all attributes (including irregular patterns) to Laravel Blade class components.

blade-wants-attributes blade-wants-attributes offers you the ability to use Blade/HTML-defined attributes within the constructors of Laravel Blade cla

laravel - Potion is a pure PHP asset manager for Laravel 5 based off of Assetic.

laravel-potion Potion is a pure PHP asset manager for Laravel based off of Assetic. Description Laravel 5 comes with a great asset manager called Elix

An abstraction layer for easily implementing industry-standard caching strategies
An abstraction layer for easily implementing industry-standard caching strategies

Laravel Model Repository This package provides an abstraction layer for easily implementing industry-standard caching strategies with Eloquent models.

Update multiple Laravel Model records, each with it's own set of values, sending a single query to your database!

Laravel Mass Update Update multiple Laravel Model records, each with its own set of values, sending a single query to your database! Installation You

This Package helps you in laravel application to log all desired activity for each request from request entry point to generate response at a single snapshot.

Laravel Scenario Logger This Package helps you in laravel application to log all desired activity for each request from request entry point to generat

Releases(v1.0)
Owner
null
Renamify is a package for Laravel used to rename a file before uploaded to prevent replacing exists file which has the same name to this new uploaded file.

Renamify Laravel package for renaming file before uploaded on server. Renamify is a package for Laravel used to rename a file before uploaded to preve

MB'DUSENGE Callixte 2 Oct 11, 2022
📦 Adds Laravel Packages Support to Lumen and Vendor Publish Artisan Command.

Laravel Package Support for Lumen: Makes Lumen compatible with Laravel Packages. You can use any Laravel Packages in Lumen by installing Larasupport Package.

Irfaq Syed 127 Dec 17, 2022
An easy way to get vendor and package data from Packagist via API calls

Laravel Packagist Laravel Packagist (LaravelPackagist) is a package for Laravel 5 to interact with the packagist api quickly and easily. Table of cont

Jeremy Kenedy 5 Jul 18, 2022
Removes whitelisted unnecessary files (like tests/docs etc.) from vendor directory

Composer vendor cleanup This is a simple script for the Composer to remove unnecessary files (documentation/examples/tests etc.) from included vendor

Chris 2 Nov 14, 2022
🔌 Autowire and configure using PHP 8 Attributes in Laravel.

?? Autowire for Laravel Autowire and configure using PHP 8 Attributes in Laravel. Installation Via Composer composer require jeroen-g/autowire You wil

JeroenG 13 Oct 7, 2022
Laravel package to generate and to validate a UUID according to the RFC 4122 standard. Only support for version 1, 3, 4 and 5 UUID are built-in.

Laravel Uuid Laravel package to generate and to validate a universally unique identifier (UUID) according to the RFC 4122 standard. Support for versio

Christoph Kempen 1.7k Dec 28, 2022
Control frontend access to properties/methods in Livewire using PHP 8 attributes.

This package adds PHP 8.0 attribute support to Livewire. In specific, the attributes are used for flagging component properties and methods as frontend-accessible.

ARCHTECH 83 Dec 17, 2022
Easily validate data attributes through a remote request

Laravel Remote Rule Easily validate data attributes through a remote request. This package allows you to define a subset of custom rules to validate a

H-FARM Innovation 27 Nov 20, 2022
Cast your Eloquent model attributes to Value Objects with ease.

Laravel Value Objects Cast your Eloquent model attributes to value objects with ease! Requirements This package requires PHP >= 5.4. Using the latest

Red Crystal Code 23 Dec 30, 2022
Guess attributes for Laravel model factories

Eloquent Populator This package provides default attributes for Laravel model factories by guessing the best Faker formatters from columns' names and

Guido Cella 68 Aug 11, 2022