Re: FreeRadius + AD + Realms
In a general regexp language, I guess that could be done with ([\w.-]+)(?=@.*).
Most regexes don't support \w, or (?... constructs.
Keep it simple:
if (User-Name =~ /^(.*)@(.*)$/) { # name = %{1} # realm = %{2} } Makes sense now :) Thanks. man regex is written mostly descriptive, it's much easier to understand on examples like these, than on "weeknights" :D
But I guess I missed to point with doing it this way, because: if (User-Name =~ /@mydomain.com/) { if (User-Name =~ /^(.*)@(.*)$/) { update request { Stripped-User-Name = %{1} } ldap } } doesn't work ^^ It gives: rlm_ldap - authorize rlmd_ldap: performing user authorization for %{1} ... Also, I tried to apply this directly in the ldap module configuration, different outcome, but also doesn't work. Where did I go wrong? -_- _________________________________________________________________ Hotmail: Trusted email with Microsoft’s powerful SPAM protection. https://signup.live.com/signup.aspx?id=60969
Matthew P wrote:
But I guess I missed to point with doing it this way, because:
if (User-Name =~ /@mydomain.com/) { if (User-Name =~ /^(.*)@(.*)$/) { update request { Stripped-User-Name = %{1}
$ man unlang This says "put the string %{1} as the value of Stripped-User-Name". See the "data types' section of the manual page, and the "strings" section. Alan DeKok.
participants (2)
-
Alan DeKok -
Matthew P