HTTP headers
Alan DeKok
aland at deployingradius.com
Tue Nov 30 14:55:37 CET 2021
On Nov 30, 2021, at 8:13 AM, Stjepan Roić <roic27 at gmail.com> wrote:
> I'm trying to set up EAP-TTLS wifi auth to REST API endpoint. I started
> with basic config and have local auth working but stuck on getting
> Access-Accept from the API. I have set up rest module but struggling to
> insert HTTP headers into the request. Can't find it in the docs and only
> previous topic I found is this one:
>
> http://lists.freeradius.org/pipermail/freeradius-users/2020-July/098472.html
Which suggests that you read mods-available/rest. Which has all of the information you need.
> where you suggested how to insert headers in post auth methods. I tried the
> same in my authenticate just before "rest" but this doesn't work.
I have no idea what that means. Saying "it doesn't work" is pretty much content-free.
If only there was some kind of debug output... or endless pages of documentation telling people to use the debug output. Or messages every day on this mailing list asking people to post the debug output.
> update control {
> &REST-HTTP-Header :="secret:
> 1f215f4a27653bd17ddc54e320a1c61e37949fe5"
> &REST-HTTP-Header :="uuid: 84ce0574-5074-4b53-9ddc-fcb2c935a1b1"
> &REST-HTTP-Header :="Content-Type: application/json"
> }
> rest
Well, if you want *all* of those to show up, then ":=" is the wrong thing to use. See "man unlang". The operators are documented. You want to use "+=".
> What is the correct way to insert HTTP header in the request for
> authentication sent to external REST server and what syntax should be used
> for multiple headers (I just multiplied rows here but not sure it should be
> like that)?
Read and follow the documentation. The file mods-available/rest documents what headers to add. The "unlang" documentation describes how to add attributes.
Alan DeKok.
More information about the Freeradius-Users
mailing list