Question on Unlang

Brian Candler b.candler at pobox.com
Sun Apr 2 15:36:25 CEST 2017


On 02/04/2017 08:23, Olivier CALVANO wrote:
> Ok, i put suffix before subrealm and:
>
> [suffix] Looking up realm "network.local" for User-Name = "
> marcy at network.local"
> [suffix] No such realm "network.local"
> ++[suffix] = noop
> [subrealm] expand: %{Realm} ->
> ++[subrealm] = noop
>
>
> It did not succeed to extract the realm no ?

Yeah, it's not quite as simple as that.

http://freeradius.org/radiusd/man/rlm_realm.html

It doesn't just split the user name into user name and realm; it also 
has to find the realm in proxy.conf before it will accept it.  This is 
probably not what you want if all you want to do is split the username, 
and are not interested in proxying.

Maybe you'd be better off splitting it with a regexp. Something like:

if (&User-Name =~ /^(.+)@(.+)$/) {
     update request {
         &Realm := "%{2}"
         subrealm
     }
     else {
         reject
     }
}





More information about the Freeradius-Users mailing list