Referring to module-specific information in post-auth
Hi, Another question for you... I don't really want to duplicate the LDAP server and Base DN information into the ldap xlats, but I can't seem to be able to pull that information in from the ldap module. I was expecting ${modules.ldap.server} to work, or ${modules:ldap.server}, or ${modules:ldap:server}, but neither work... Have you got any suggestions how I can do this? :-) With Regards Stefan Paetow Moonshot Industry & Research Liaison Coordinator t: +44 (0)1235 822 125 gpg: 0x3FCE5142 xmpp: stefanp@jabber.dev.ja.net skype: stefan.paetow.janet jisc.ac.uk Jisc is a registered charity (number 1149740) and a company limited by guarantee which is registered in England under Company No. 5747339, VAT No. GB 197 0632 86. Jisc¹s registered office is: One Castlepark, Tower Hill, Bristol, BS2 0JA. T 0203 697 5800.
On Nov 10, 2016, at 8:19 PM, Stefan Paetow <Stefan.Paetow@JISC.AC.UK> wrote:
Another question for you... I don't really want to duplicate the LDAP server and Base DN information into the ldap xlats, but I can't seem to be able to pull that information in from the ldap module.
I was expecting ${modules.ldap.server} to work, or ${modules:ldap.server}, or ${modules:ldap:server}, but neither work...
Have you got any suggestions how I can do this? :-)
Post more of what you tried. You need to specify the complete config path (section, subsection) from the top. See the SQL module for examples of referring to a specific instance. Alan DeKok.
I was expecting ${modules.ldap.server} to work, or ${modules:ldap.server}, or ${modules:ldap:server}, but neither work...
Have you got any suggestions how I can do this? :-)
Post more of what you tried. You need to specify the complete config path (section, subsection) from the top.
Ok, I'm trying to do this: In the ldap module you have the config entries 'server' and 'base_dn'. In the post-auth section, I tried to do this: update reply { Tmp-String-1 := "%{ldap:ldap://${modules.ldap.server}/${modules.ldap.base_dn}?uid??(&(objec tClass=user)(accountMapping=%{reply:Chargeable-User-Identity}}" } On initial start the ${...} values are expected to be replaced by their real equivalents. Given that "policy" exists in the "policy" entry in radiusd.conf, and "client" in "clients.conf" (where each is defined), I was expecting "modules" to be accessible? There is something I'm missing, isn't it? Something really silly? Stefan Paetow Moonshot Industry & Research Liaison Coordinator t: +44 (0)1235 822 125 gpg: 0x3FCE5142 xmpp: stefanp@jabber.dev.ja.net skype: stefan.paetow.janet jisc.ac.uk Jisc is a registered charity (number 1149740) and a company limited by guarantee which is registered in England under Company No. 5747339, VAT No. GB 197 0632 86. Jisc¹s registered office is: One Castlepark, Tower Hill, Bristol, BS2 0JA. T 0203 697 5800.
On Nov 11, 2016, at 5:33 PM, Stefan Paetow <Stefan.Paetow@JISC.AC.UK> wrote
In the ldap module you have the config entries 'server' and 'base_dn'.
In the post-auth section, I tried to do this:
update reply { Tmp-String-1 := "%{ldap:ldap://${modules.ldap.server}/${modules.ldap.base_dn}?uid??(&(objec tClass=user)(accountMapping=%{reply:Chargeable-User-Identity}}" }
On initial start the ${...} values are expected to be replaced by their real equivalents.
They should be.
Given that "policy" exists in the "policy" entry in radiusd.conf, and "client" in "clients.conf" (where each is defined), I was expecting "modules" to be accessible?
All configuration items are accessible via the expansion ${..} i.e. ${section.subsection1.subsection2.item} These strings are expanded when the server starts, and are treated as fixed strings after that.
There is something I'm missing, isn't it? Something really silly?
No idea. What does the debug output show? Alan DeKok.
On Fri, Nov 11, 2016 at 10:33:50PM +0000, Stefan Paetow wrote:
was expecting "modules" to be accessible? There is something I'm missing, isn't it?
The debug output :)
Something really silly?
It works fine here on ~3.0.12: e.g. authorize { update reply { Tmp-String-0 := ${modules.ldap.server} } } with modules { ldap { server = "localhost" } } Tmp-String-0 expands to "localhost". Similarly with instance names, update reply { Tmp-String-0 := ${modules.ldap[ldap1].server} } with modules { ldap ldap1 { server = "localhost2" } } Tmp-String-0 expands to "localhost2". Similarly works with e.g. Tmp-String-0 := "foo-${modules.ldap[ldap1].server}-bar" and expands to "foo-localhost2-bar". Matthew -- Matthew Newton, Ph.D. <mcn4@leicester.ac.uk> Systems Specialist, Infrastructure Services, I.T. Services, University of Leicester, Leicester LE1 7RH, United Kingdom For IT help contact helpdesk extn. 2253, <ithelp@le.ac.uk>
On Fri, Nov 11, 2016 at 10:33:50PM +0000, Stefan Paetow wrote:
was expecting "modules" to be accessible? There is something I'm missing, isn't it?
The debug output :)
:-P
Something really silly?
And it *was* something really silly... like not uncommenting the surrounding 'update reply {' and '}' to actually make it valid unlang. *sigh* Stefan Paetow Moonshot Industry & Research Liaison Coordinator t: +44 (0)1235 822 125 gpg: 0x3FCE5142 xmpp: stefanp@jabber.dev.ja.net skype: stefan.paetow.janet jisc.ac.uk Jisc is a registered charity (number 1149740) and a company limited by guarantee which is registered in England under Company No. 5747339, VAT No. GB 197 0632 86. Jisc’s registered office is: One Castlepark, Tower Hill, Bristol, BS2 0JA. T 0203 697 5800.
participants (3)
-
Alan DeKok -
Matthew Newton -
Stefan Paetow