add a realm to a User-Name if no realm

Lewis Bergman lbergman at wtxs.net
Thu Oct 6 01:17:37 CEST 2005


I am in need of rewriting a username in a request to include a domain.
Basically, if a user comes in as "user" add the realm "@dom.com" so it is
checked as "user at dom.com". I found this in the archives which seems to be
close.
http://www.mail-archive.com/freeradius-users@lists.freeradius.org/msg15228.html

I presume the solution above would go in the users file. I need to be able
to do this differently per client. Is this possible?

So I added DEFAULT   User-Name !~ "@", User-Name := "%{User-Name}@dom.com"
but that fails to yeild the result I was looking for. I see from the debug
that it is matched
users: Matched entry DEFAULT at line 223

But that user isn't in the users file, they are all in MySQL. As a result,
do I need that in the sql.conf or one of the preprocess files? I did add
the user to the user file but authentication still failed.

I have also studied variables.txt but seem unable to make this work. I
even tried making my own preprocess file. I didn't expect it to work and I
wasn't dissappointed.

Any help appreciated.
-- 
Lewis Bergman
Texas Communications
4309 Maple ST.
Abilene, TX 79602
325-691-3301



More information about the Freeradius-Users mailing list