Passing data to custom xlat function
Alan DeKok
aland at deployingradius.com
Fri Aug 27 22:45:26 CEST 2021
On Aug 27, 2021, at 4:36 PM, g4-lisz at tonarchiv.ch wrote:
> I wonder if there is a way to "transport" data to an xlat function on
> another way than attaching it to a Radius request...
All data is associated with a request. Or, it's static in the configuration files.
There really isn't any other way to do this.
> I'm asking this because we have quite a lot of parameters that we want
> to be expanded in the module config file.
>
> These parameters depend on the user realm. So when a request comes in,
> our module does a look up in a realm to connection data table. This
> connection data again is used to make a REST authentication.
>
> In the module config we have something like this:
>
> uri = "https://%{control:Cust-Gateway}/api/%{control:Cust-App-Id}/etc/..."
> data =
> 'grant_type=password&username=%{urlquote:%{control:Cust-Client-Id}}&password=%{urlquote:%{control:Cust-Client-Secret}}'
>
> In the authorize function we do the DB call and when the realm is valid
> we add these custom attributes to the request.
>
> This works, but maybe there's a more elegant way than adding attributes
> to the request only for xla expansion.
That's really the best way to do it.
Alan DeKok.
More information about the Freeradius-Users
mailing list