Matthew,

I needed to do the same thing.  I found an easy solution that might work
to you also.

I store the users in a mysql table that looks like this:

user | domain          | password
=====+=================+=========
john | picles.com      | secret
bill | smoochie.com.br | duh

The I use the concat mysql function to match both user and domains, like
this:

authorize_check_query = "SELECT '1', user, 'User-Password', password,
':=' from tbl_users where concat(user,'@',domain) = '%{User-Name}';

authenticate_query = "select password, 'User-Password' from tbl_users where
concat(user,'@',domain) = '%{User-Name}'"


Hope that helps.


Regards from Brazil, Henrique.

On Thu, 16 Jan 2003 15:37:30 -0500
"Matthew M. Gamble" <[EMAIL PROTECTED]> wrote:

> Greetings, 
> 
>     I am trying to setup Freeradius with MySQL, and have a quick question about the 
>variables available in my SQL queries.
> 
>     Right now, I have FreeRadius / MySQL working, and stripping realms, and 
>authenticating users correctly.  My question is this - can I get the realm that was 
>stripped as a variable?  For example, if a user logs in as [EMAIL PROTECTED], I want 
>to do a select where username = 'user' and domain 'testing.com'.  
> 
> Is this possible?  Sorry if this was asked before, but since the list archives 
>aren't searchable, I figure it was faster to ask again rather than wade through all 
>of the back messages.
> 
> Thanks, 
> 
> M. Gamble
> 



- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Reply via email to