plpgsql freeradius authentication function
Kafui Akyea
kakyea at gmail.com
Mon Oct 18 22:39:24 CEST 2010
Hi
There is one more problem i am encountering although the function works.
If i try to authenticate a user who is not valid i do not get an
Access-Reject but rather
i get
RADIUS: Retransmit to (192.168.1.12:1812,1813) for id 1645/201
RADIUS: Retransmit to (192.168.1.12:1812,1813) for id 1645/201
RADIUS: Retransmit to (192.168.1.12:1812,1813) for id 1645/201
RADIUS: No response from (192.168.1.12:1812,1813) for id 1645/201
RADIUS/DECODE: No response from radius-server; parse response; FAIL
RADIUS/DECODE: Case error(no response/ bad packet/ op decode);parse
response; FAIL
But that for a valid user works just fine
I implemented this in the freeradius postgresql.conf file
SELECT id,username,attribute,value,op FROM try('7140944444','0000') as(id
integer,username varchar,attribute varchar,value varchar,op character);
and implemented this function on the Postgres database server
CREATE OR REPLACE FUNCTION try (your_name TEXT, tiger TEXT) RETURNS RECORD
AS $$
DECLARE
users_rec RECORD;
BEGIN
if tiger = '0000' then
SELECT INTO users_rec * FROM aniradcheck WHERE username = your_name;
else
SELECT INTO users_rec * FROM radcheck WHERE username = your_name;
end if;
RETURN users_rec.username;
END;
$$ LANGUAGE plpgsql;
Help will be very much appreciated
On Mon, Oct 18, 2010 at 2:23 PM, Kafui Akyea <kakyea at gmail.com> wrote:
> Alan,
>
> Thanks a lot that worked
>
> Kafui
>
>
> On Mon, Oct 18, 2010 at 11:52 AM, Alan DeKok <aland at deployingradius.com>wrote:
>
>> Kafui Akyea wrote:
>> > Hi
>> >
>> > I implemented this in the freeradius postgresql.conf file
>> > SELECT id,username,attribute,op,value
>>
>> That's the wrong order. See the default SELECT in
>> raddb/sql/postgresql/dialup.conf.
>>
>> > I am generally trying to authenticate with a postgres function
>>
>> Make sure it returns exactly the same information, in the same order,
>> as the default queries.
>>
>> Alan DeKok.
>> -
>> List info/subscribe/unsubscribe? See
>> http://www.freeradius.org/list/users.html
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20101018/24870849/attachment.html>
More information about the Freeradius-Users
mailing list