Username manipulation

Arran Cudbard-Bell a.cudbardb at googlemail.com
Mon Jun 7 20:41:32 CEST 2010


On Jun 7, 2010, at 11:35 AM, Greg Malewski wrote:

> Hi, I have been unable to find any examples - if the facility exists - of being able to process a username prior to forwarding it. For example, I may wish to take a username such as joe_bloggs and convert it into joe.bloggs prior to passing it on to the authentication oracle.

authorize {
if(User-Name =~ /([^_]+)_(.*)/){
	update request {
		User-Name := "%{1}.%{2}"
	}
}
....
}


> 
> Furthermore, is it possible to only do this with some RADIUS clients?

Yes. Use conditional checks on the Client-Shortname attribute. See man unlang.

-Arran



More information about the Freeradius-Users mailing list