share information between authorize and authenticate sections (rlm_perl & rlm_python)
Hello, If someone can advise me... How to share information between the authorize() function and the authenticate() function within a perl or python script ? For example, i get some information from a database in authorize() that will reuse it in authenticate()? I could resubmit the sql request again, but it is clearly not efficient. in perl, i could write some new attributes in RAD_CHECK ??, then authenticate() will access them. in python, attributes are read only, so i cannot use them to pass information to authenticate(). A simple database, like redis, could be a solution by adding info with the id of the request (with Message-Authenticator as key)? If someone has an idea, it is very welcome... Regards, Laurent
Hi,
in perl, i could write some new attributes in RAD_CHECK ??, then authenticate() will access them. in python, attributes are read only, so i cannot use them to pass information to authenticate(). A simple database, like redis, could be a solution by adding info with the id of the request (with Message-Authenticator as key)?
we use and update private internal FreeRADIUS attributes alan
On 12/12/12 22:04, laurent.feron@free.fr wrote:
Hello,
If someone can advise me... How to share information between the authorize() function and the authenticate() function within a perl or python script ?
Just set an attribute: authorize { update request { Tmp-String-0 := "%{some:expansion}" } ... } authenticate { Auth-Type XXX { if (Tmp-String-0 == "a") { module_a } else { module_b } } } ...re-work as appropriate for your use-case.
Yes, just found this attribute. Thanks. Works well with Perl :), but not with Python :( ----- Mail original ----- De: "Phil Mayers" <p.mayers@imperial.ac.uk> À: freeradius-users@lists.freeradius.org Envoyé: Jeudi 13 Décembre 2012 13:05:23 Objet: Re: share information between authorize and authenticate sections (rlm_perl & rlm_python) On 12/12/12 22:04, laurent.feron@free.fr wrote:
Hello,
If someone can advise me... How to share information between the authorize() function and the authenticate() function within a perl or python script ?
Just set an attribute: authorize { update request { Tmp-String-0 := "%{some:expansion}" } ... } authenticate { Auth-Type XXX { if (Tmp-String-0 == "a") { module_a } else { module_b } } } ...re-work as appropriate for your use-case. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
participants (3)
-
Alan Buxey -
laurent.feron@free.fr -
Phil Mayers