Stripping domain from username

Alan DeKok aland at deployingradius.com
Tue Aug 7 22:24:38 CEST 2007


Nicholas Hall wrote:
> According to what I've read the HINTS file is the best place to do
> this.  Here is relevant portions of my config running CVS from
> 2007-08-01.  It's my understanding that with Strip-User-Name = Yes,
> FreeRADIUS will rewrite the User-Name attribute without the domain
> specified.

  The server doesn't do that.  You've got to tell it what part is the
username, and what part is the domain name.

> ----------------------------------------------------------------------------------------
> DEFAULT Suffix == "@alexssa.net", Strip-User-Name = Yes

  In the CVS head, you can use the new "unlang" feature, in the
"authorize" section:

authorize {
	...
	if ("%{User-Name}" =~ /^(.*)@alexssa.net$/) {
		update request {
			Stripped-User-Name = "%{1}"
		}
	}
	...

  See "man unlang" for details.

  Alan DeKok.



More information about the Freeradius-Users mailing list