Radiator Server Documentation — v10.34.2
scripts.context.aaa
Lua script context API - AAA sub-context
aaa
AAA processing state and identity information.
Fields
| Field | Type | Access | Description |
|---|---|---|---|
protocol | string? | read | Protocol name (radius, eap_ttls, etc.) |
trace | boolean | read | Is request tracing enabled? |
accounting | boolean? | read | Is this an accounting request? |
policy | string? | read | Name of AAA policy handling request |
handler | string? | read | Name of AAA handler handling request |
identity | string? | read/write | Current username/identity |
method | string? | read | Authentication method (pap, chap, mschap, etc.) |
message | string? | read/write | Reply message |
result | string? | read | AAA result (accept, reject, challenge, etc.) |
reason | string? | read | Error or rejection reason |
Lua context.aaa.protocol returns a lowercase protocol name, such as radius,
eap_ttls, tacacs_plus, or management, or nil when unset. RadConf policy conditions
compare the enum with named constants, such as aaa.protocol == protocol.RADIUS.
See AAA protocol.
context.aaa.result returns a lowercase result name, or nil when unset.
Compare it directly, for example context.aaa.result == "accept".
Post pipelines expose the corresponding main pipeline result; final pipelines
expose the final AAA result. Unlike Lua, direct RadConf access is numeric; use
"%{aaa.result}" for the lowercase name in RadConf.
Example
local context, previous = ...
local aaa = context.aaa
-- Check protocol
if aaa.protocol == "radius" then
-- Modify identity
aaa.identity = "modified@realm.com"
-- Set reply message
aaa.message = "Welcome!"
end
return previous