<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Thanks so much for the reply.<br><br>I tried as Alex mentioned as realm base routing and it is working fine.<br><br><pre>realm google.com {<br> type = radius<br> authhost = LOCAL<br> accthost = LOCAL<br> strip<br>}<br></pre><br>Thanks so much.<br>Regards.<br><br>--- On <b>Sat, 10/11/08, Arran Cudbard-Bell <i><A.Cudbard-Bell@sussex.ac.uk></i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;">From: Arran Cudbard-Bell <A.Cudbard-Bell@sussex.ac.uk><br>Subject: Re: Regex remove realm from username<br>To: "FreeRadius users mailing list" <freeradius-users@lists.freeradius.org><br>Cc: workoutexcite@yahoo.com<br>Date: Saturday, October 11, 2008, 2:12 PM<br><br><pre>-----BEGIN PGP SIGNED MESSAGE-----<br>Hash: SHA1<br><br>Alex French wrote:<br>> 2008/10/10 Eric
Martell <workoutexcite@yahoo.com>:<br>>> Hi..<br>>> I searched thru the forums but not getting the right username after<br>using<br>>> regex.<br>>> The request I am getting is : test@google.com and I need to strip<br>everything<br>>> after @ and pass the username as test.<br>> <br>> Is there some reason you don't just create a local realm in proxy.conf<br>> and use the 'strip' keyword?<br>> <br>> realm google.com {<br>> type = radius<br>> authhost = LOCAL<br>> accthost = LOCAL<br>> strip<br>> }<br>> <br>> <br>> Thanks,<br>> <br><br><br>We use:<br><br>if("%{User-Name}"){<br> if("%{User-Name}" =~ /^([^@]*)(@([-[:alnum:].]+))?$/){<br> update request {<br> Stripped-User-Name := "%{1}"<br> }<br> # User Names not containing a domain default to<br> # <default><br> update request {<br> Stripped-User-Domain =
"%{%{3}:-<default>}"<br> }<br> }<br> # Username in unrecognised format<br> else{<br> reject<br> }<br>}<br><br>Thanks,<br>Arran<br><br>> Alex<br>> -<br>> List info/subscribe/unsubscribe? See<br>http://www.freeradius.org/list/users.html<br><br><br>- --<br>Arran Cudbard-Bell (A.Cudbard-Bell@sussex.ac.uk),<br>Authentication, Authorisation and Accounting Officer,<br>Infrastructure Services (IT Services),<br>E1-1-08, Engineering 1, University Of Sussex, Brighton, BN1 9QT<br>DDI+FAX: +44 1273 873900 | INT: 3900<br>GPG: 86FF A285 1AA1 EE40 D228 7C2E 71A9 25BB 1E68 54A2<br>-----BEGIN PGP SIGNATURE-----<br>Version: GnuPG v1.4.8 (Darwin)<br>Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org<br><br>iEYEARECAAYFAkjw7HgACgkQcaklux5oVKIwGgCfZovEGnbvxft69Td8PcfRw5oK<br>Y78An0KNXZYmeXh2kb6IuSsOBQZhbbAt<br>=LKbU<br>-----END PGP SIGNATURE-----<br></pre></blockquote></td></tr></table><br>