Wow this was fast. Thank you Alan for the straightforward answer and the confirmation of our approach. Till On 27.08.21 22:45, Alan DeKok wrote:
On Aug 27, 2021, at 4:36 PM, g4-lisz@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.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html