New module - Native .NET policy support for FreeRADIUS
Hi everyone, I'm pleased to announce that I have submitted a new module for FreeRADIUS called rlm_dotnet, which enables writing FreeRADIUS policies and modules in C# and other .NET languages. Pull Request: https://github.com/FreeRADIUS/freeradius-server/pull/5852 rlm_dotnet hosts the Microsoft .NET runtime using hostfxr and allows FreeRADIUS to call managed code directly. This makes it possible to implement FreeRADIUS policies in: - C# - F# - VB.NET - Any other language targeting the .NET runtime The design supports both synchronous and asynchronous policies, and provides strongly typed access to RADIUS requests and replies. - Native integration with the .NET runtime (hostfxr) - Strongly typed request and reply objects - Support for all major FreeRADIUS processing sections - Async/await support using ValueTask - Structured binary request/reply formats (RDb1 / RDr1) - Structured JSON error reporting - Access to native FreeRADIUS logging (radlog) - Per-thread or shared policy instances - Comprehensive XML documentation and examples - Unit tests and smoke tests - Full C# Sdk included A minimal policy can be as simple as: public sealed class MyPolicy : IRadiusPolicy { public (int Rcode, string ReplyPairList) Authorize(RadiusRequest request) => (RlmRcode.Ok, IRadiusPolicy.EmptyReply); } Async policies are also supported for database, HTTP, Redis, LDAP, or other I/O-bound operations. The .NET CLR is shared across all instances initiated by FreeRADIUS, and as such memory is shared across all instances and not destroyed each time FreeRADIUS recycles the process. This makes extensive in-memory usage highly viable and was one of the main reasons why the module was developed (in memory, shared session-db). FreeRADIUS has long supported embedded languages such as Python and Perl. rlm_dotnet brings modern .NET capabilities to the platform, including: - Strong typing - Excellent tooling and debugging - High performance - Rich ecosystem libraries - Modern asynchronous programming This makes it easier for organizations with existing .NET expertise to build custom AAA logic directly within FreeRADIUS. The pull request includes: - Full and comprehensive documentation - Assembly-level XML documentation - A comprehensive ExamplePolicy - Unit tests and smoke tests - Full C# Sdk - Feedback Welcome Thank you to the FreeRADIUS team for building such a powerful and extensible platform. Kind regards, Chris Knipe
On May 15, 2026, at 3:53 AM, Chris Knipe via Freeradius-Users <freeradius-users@lists.freeradius.org> wrote:
I'm pleased to announce that I have submitted a new module for FreeRADIUS called rlm_dotnet, which enables writing FreeRADIUS policies and modules in C# and other .NET languages.
Does this build on Windows? We've put some effort into Windows compatability, but it's nowhere near done. It's a lot of work to do. Alan DeKok.
Hi Alan, Builds on Windows as well as Linux. .NET and the .NET SDK must be installed on Linux to have the libraries to compile against. rlm_dotnet (FR Interface) is C, it is only the example application that is .NET. Regards, Chris. -----Original Message----- From: Alan DeKok <alan.dekok@inkbridge.io> Sent: Friday, 15 May 2026 20:59 To: FreeRadius users mailing list <freeradius-users@lists.freeradius.org> Cc: Chris Knipe <cknipe@opticnetworks.net> Subject: Re: New module - Native .NET policy support for FreeRADIUS On May 15, 2026, at 3:53 AM, Chris Knipe via Freeradius-Users <freeradius-users@lists.freeradius.org> wrote:
I'm pleased to announce that I have submitted a new module for FreeRADIUS called rlm_dotnet, which enables writing FreeRADIUS policies and modules in C# and other .NET languages.
Does this build on Windows? We've put some effort into Windows compatability, but it's nowhere near done. It's a lot of work to do. Alan DeKok.
participants (2)
-
Alan DeKok -
Chris Knipe