How freeradius responds in json format to the request to authorize

Arran Cudbard-Bell a.cudbardb at freeradius.org
Sun Jul 23 15:58:57 CEST 2017


> On 23 Jul 2017, at 09:25, Fiorella De Luca via Freeradius-Users <freeradius-users at lists.freeradius.org> wrote:
> 
> Hello! I am a new Freeradius user. I'm participating in the Google Summer Code and I'm working on an OpenWISP project regarding the creation of a freeradius web interface. This app Django-freeradius will be a web interface to a manage freeradius database using a Django Rest framework .

That’s a good choice.  We had a project to do that a while back, it just didn’t end up progressing far.

I think the approach of using the Rest interface instead SQL is good.  The SQL format is too limiting.

> I installed FreeRADIUS Version 3.0.12 on Ubuntu.
> I am using rlm_rest So I can configure freeradius to delegate some or all of its operations (authorization, authentication, accounting, mail order)

Not sure what “mail order” is, but sure.

> to a REST API.
> But I can not understand how freeradius responds in json format to the request to authorize .
> I tried to accept the user with Auth-Type: = Accept
> And for the user to refuse: Auth-Type: = Reject but it does not work. If anyone could give me an explanation
> I'll be more than happy. Thank you!

The request/response format is documented here:

	https://github.com/FreeRADIUS/freeradius-server/blob/v4.0.x/raddb/mods-available/rest#L92

If you want response attributes to go into different lists, then you can qualify the attribute name with a list name.

For your example of Auth-Type the JSON for ‘Accept’ would be:

{
	“control:Auth-Type”:”Accept"
}

and for reject:

{
	“control:Auth-Type”:”Reject"
}

Let me know if this doesn’t work.  I’m fairly sure I added list qualifier extraction to the rim_rest module.  If I didn’t it’s a simple fix.

-Arran
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20170723/3c3c93c6/attachment.sig>


More information about the Freeradius-Users mailing list