rlm_rest: Parsing the response attributes

Michael Schwartzkopff ms at sys4.de
Wed Jul 24 11:41:25 UTC 2024


On 24.07.24 12:38, Nick Porter wrote:

> On 24/07/2024 06:49, Michael Schwartzkopff via Freeradius-Users wrote:
>>
>> rest: Failed parsing attribute: Invalid vendor name in attribute name 
>> "count", skipping
>
> FreeRADIUS version 3 expects that JSON responses will match one of a 
> number of defined formats:
>
>
> {
>     "<attribute0>":{
>         "do_xlat":<bool>,
>         "is_json":<bool>,
>         "op":"<operator>",
>         "value":[<value0>,<value1>,<valueN>]
>     },
>     "<attribute1>":{
>         "value":{
>             "<nested-attribute0>":{
>                 "op":"<operator>",
>                 "value":<value0>
>             }
>         }
>     },
>     "<attribute2>":"<value0>",
>  "<attributeN>":[<value0>,<value1>,<valueN>]
> }
>
>
> Your sample data most closely matches the example "attribute2" in the 
> format - so FreeRADIUS is looking to populate an attribute "count" 
> with the provided value, but that does not exist in the dictionary.
>
> You could define local attributes matching the names found in your 
> JSON responses, which will then be populated with the data in the 
> response.
>
> It will be important to define all the possible objects which will be 
> returned even if they are not used.
>
>
> FreeRADIUS v4 will make this much easier with the "json map" construct 
> which allows arbitrary objects from a json structure to be used in 
> populating attributes.
>
>

Thanks. Defining a custom dictionary solved the problem for now.




More information about the Freeradius-Users mailing list