Simple question for migration to Freeradius

Alan DeKok aland at deployingradius.com
Fri Oct 12 18:09:44 CEST 2018


On Oct 12, 2018, at 1:56 AM, Olaf s <siegson at hotmail.com> wrote:
> 
> After many years we want to migrate from Steel-belted Radius to Freeradius.

  That's good!

> Current Freeradius setup (and working)
> 
> Centos 7.5
> 
> MSSQL (due to application requirements)
> 
> Default sql schema as provided with Freeradius.

  You don't need to use that.  It's a default, not a requirement.

> 
> The only requirement we have is that we need to lookup the username in a table somewhere in our own mssql db (not the freeradius db)
> 
> If the username is in the table: send accept. (not even using password)

  You can run SQL queries yourself, pretty much anywhere in the server configuration.  You don't need to use the "sql" module (as such), or it's schema, or the queries,

authorize {
	...

	if ("%{sql: SELECT user from my_table WHERE user='%{User-Name}'" != "") {
		accept
	}
	..

  That should do it.

> From debug i can see this:
> 
> 
> (0) sql: EXPAND %{User-Name}
> (0) sql:    --> 32490013984
> (0) sql: SQL-User-Name set to '32490013984'
> rlm_sql (sql): Reserved connection (0)
> (0) sql: EXPAND SELECT id, UserName, Attribute, Value, op FROM radcheck WHERE Username = '%{SQL-User-Name}' ORDER BY id
> (0) sql:    --> SELECT id, UserName, Attribute, Value, op FROM radcheck WHERE Username = '32490013984' ORDER BY id
> (0) sql: Executing select query: SELECT id, UserName, Attribute, Value, op FROM radcheck WHERE Username = '32490013984' ORDER BY id
> (0) sql: User found in radcheck table
> 
> how can i adjust the select query and change it to fit my own sql schema.

  Don't do that.  The default queries are meant to be used with the default schema.  If you're using a custom schema, just ignore the default queries.

  Alan DeKok.




More information about the Freeradius-Users mailing list