<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Hi..<br> I searched thru the forums but not getting the right username after using regex.<br>The request I am getting is : test@google.com and I need to strip everything after @ and pass the username as test.<br><br>I am using ldap for auth. This is the config I have in ldap.<br><br><br> if (User-Name =~ /^([^@]+)(@.*)$/) { // just want to dblchck is the right regex<br> update request {<br> Stripped-User-Name :=
"%{0}"<br> }<br> }<br><br><br> filter = "(uid=%{Stripped-User-Name})"<br> //filter = "(uid=%{Stripped-User-Name:-%{User-Name}})"<br> //filter = "(uid=%{Stripped-User-Name})"<br> encryption_scheme = crypt<br><br>I get the following while ldap lookup expand: (uid=%{Stripped-User-Name}) -> (uid=)<br><br><br>Here is the radius -X log ;<br>rad_recv: Access-Request packet from
host 216.2.193.1 port 55751, id=107, length=65<br> User-Name = "test@google.com"<br> User-Password = "test123"<br>+- entering group authorize<br>++[preprocess] returns ok<br>++[chap] returns noop<br>++[mschap] returns noop<br> rlm_realm: Looking up realm "google.com" for User-Name = "test@google.com"<br> rlm_realm: No such realm "google.com"<br>++[suffix] returns noop<br> rlm_eap: No EAP-Message, not doing EAP<br>++[eap] returns noop<br>++[unix] returns notfound<br>++[files] returns noop<br>++- entering group <br>rlm_ldap: - authorize<br>rlm_ldap: performing user authorization for test@google.com<br> expand: (uid=%{Stripped-User-Name}) -> (uid=)<br> expand: dc=xyz,dc=net,o=internet -> dc=xyz,dc=net,o=internet<br>rlm_ldap: ldap_get_conn:
Checking Id: 0<br><br></td></tr></table><br>