Freeradius authentication from Postgres?

Alan DeKok aland at deployingradius.com
Wed Jun 10 15:56:37 CEST 2015


On Jun 10, 2015, at 9:54 AM, Kim Halavakoski <khalavakoski at gmail.com> wrote:
> Is it possible to get user authentication from an existing database containing fields for username and password and use this info in authenticating Radius users? 

  Yes.  Just write an SQL query to do that.

> What kind of configuration would this require, as I would not like to change the existing database structure with new fields and I just need the usernames and passwords from the database, any other required configurations can be done in static configuration files if needed. 

  That's fine.

> Effectively just replacing the following user file to be fetched from a database with username and password fields:
> 
>> testuser Cleartext-Password := "password"
> 
> 
> Anybody have example configurations for such a setup?

  In raddb/sites-available/default, in the authorize section, write:

	update control {
		Cleartext-Password := "%{sql:SELECT password FROM table where name = %{User-Name}}"
	}

  Or whatever SQL query works for you.

  Alan DeKok.




More information about the Freeradius-Users mailing list