FreeRadius + AD + Realms

Alan DeKok aland at deployingradius.com
Sat Jul 3 15:56:43 CEST 2010


Matthew P wrote:
> I forgot to mention that I need the "user" portion of "user at mydomain.com" for sql too.
> "user at mydomain.com" only needs to be sent to the home server (in case the user doesn't have "@mydomain.com" or "@mydomain2.com"). In another words, both AD and DB contain usernames, without any realms.
> I've been reading http://freeradius.org/radiusd/man/unlang.html, and can't seem to figure out how to make the logic - "take everything before @ as a username". So please help.

  See "man regex" for the regex format.

> 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}		
	}

  Alan DeKok.



More information about the Freeradius-Users mailing list