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@dom.com". I found this in the archives which seems to be close. http://www.mail-archive.com/freeradius-users@lists.freeradius.org/msg15228.h... 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
I wasn't quite specific enough on my post. The NULL match in the realm module would probably work for the "no realm at all" situation. I was hoping to look for a specific %{NAS-Identifier} and based on that AND the fact that a user does not have an "@" in the username, add the realm. -- Lewis Bergman Texas Communications 4309 Maple ST. Abilene, TX 79602 325-691-3301
Lewis Bergman wrote:
I wasn't quite specific enough on my post. The NULL match in the realm module would probably work for the "no realm at all" situation.
I was hoping to look for a specific %{NAS-Identifier} and based on that AND the fact that a user does not have an "@" in the username, add the realm.
I did something a bit similar, we are operating the NAS for another ISP that doesn't use the realm in their usernames. I put this in the users file to force it to be proxied: DEFAULT Called-Station-Id == "515XXXXXXX", Proxy-To-Realm := "otherisp" You should be able to do something similar. dave
"Lewis Bergman" <lbergman@wtxs.net> wrote:
I was hoping to look for a specific %{NAS-Identifier} and based on that AND the fact that a user does not have an "@" in the username, add the realm.
Try using "hints" DEFAULT User-Name !~ ".*@", NAS-Identifier == "foo" User-Name := "%{User-name}@realm" Alan DeKok.
Alan DeKok said:
"Lewis Bergman" <lbergman@wtxs.net> wrote:
I was hoping to look for a specific %{NAS-Identifier} and based on that AND the fact that a user does not have an "@" in the username, add the realm.
Try using "hints"
DEFAULT User-Name !~ ".*@", NAS-Identifier == "foo" User-Name := "%{User-name}@realm" You, my friend, are wonderful. Please tell me how I might be able to show my gratitude.
-- Lewis Bergman Texas Communications 4309 Maple ST. Abilene, TX 79602 325-691-3301
participants (3)
-
Alan DeKok -
Dave Weis -
Lewis Bergman