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, tacacs+, http, 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 |
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