Hi there, I have a question about prefix realms and stripping them. I have a provider that allows roaming dialup for our customers. They require the username to be in a format of idm/something/username. I get the whole idm/something/username delivered to me as the authentication. I have tried using the IPASS prefix to remove the idm/something, but it just returns the realm of idm and I am still left with stripped-user-name of something/username, I have also tried just adding a realm of "idm/something" to the proxy.conf and it didn't work. I am currently running freeradius 2.0.5 with a SQL (mysql) back end. Can I strip the "idm/something/" somehow? Thanks, Jeff.
Hi,
Can I strip the "idm/something/" somehow?
sure. a simple strip in the config would work... or unlang of course. eg in radiusd.conf attr_rewrite copy.user-name { attribute = Stripped-User-Name new_attribute = yes searchfor = "" searchin = packet replacewith = "%{User-Name}" } attr_rewrite remove-junk { attribute = Stripped-User-Name searchfor = "/idm\/something\/" searchin = packet new_attribute = no replacewith = "" } then in sites-enabled/default (or usual server) add copy.user-name remove-junk in the authorize section alongside prefix, suffix, ntrealm etc alan
Subject: Re: realm question Hi,
Can I strip the "idm/something/" somehow?
sure. a simple strip in the config would work... or unlang of course. eg in radiusd.conf attr_rewrite copy.user-name { attribute = Stripped-User-Name new_attribute = yes searchfor = "" searchin = packet replacewith = "%{User-Name}" } attr_rewrite remove-junk { attribute = Stripped-User-Name searchfor = "/idm\/something\/" searchin = packet new_attribute = no replacewith = "" } then in sites-enabled/default (or usual server) add copy.user-name remove-junk in the authorize section alongside prefix, suffix, ntrealm etc ------------------ Hi Alan, Thank you for your reply, it worked great with a couple of tweaks. For those trying to implement the same type of idea, the code works great when added to the modules/attr_rewrite module instead of in the radiusd.conf file. In your sites-available/whatever, the order of the processing is important. I have a realm setup to strip off after the @domain, but if the attr_rewrite modules are called before the suffix module, the suffix module will not pass the stripped-user-name that was required in my case, it will pass the whole user@domain as the username. If you place the rewrite modules names after the suffix, everything works great. Cheers, Jeff.
participants (2)
-
A.L.M.Buxey@lboro.ac.uk -
Jeff Crowe