rlm_rest JSON format for multiple attributes
Arran Cudbard-Bell
a.cudbardb at freeradius.org
Thu Mar 27 11:17:17 CET 2014
On 26 Mar 2014, at 19:32, Werner Stucky <wernerml at stucky-solutions.net> wrote:
> body = "post" seems to be working fine
>
> I'm getting the multiple Framed-Route attributes too :)
Well that's good :)
> Not sure about the body = "json"
And that's really weird..
Thu Mar 27 10:13:10 2014 : Debug: (1) # Executing section authorize from file /usr/local/freeradius-3.0.x/etc/raddb/sites-enabled/default
Thu Mar 27 10:13:10 2014 : Debug: (1) authorize {
Thu Mar 27 10:13:10 2014 : Debug: (1) modsingle[authorize]: calling rest (rlm_rest) for request 1
Thu Mar 27 10:13:10 2014 : Debug: rlm_rest (rest): Reserved connection (4)
Thu Mar 27 10:13:10 2014 : Debug: (1) rest : Expanding URI components
Thu Mar 27 10:13:10 2014 : Debug: http://127.0.0.1:9090
Thu Mar 27 10:13:10 2014 : Debug: Parsed xlat tree:
Thu Mar 27 10:13:10 2014 : Debug: literal --> http://127.0.0.1:9090
Thu Mar 27 10:13:10 2014 : Debug: (1) rest : EXPAND http://127.0.0.1:9090
Thu Mar 27 10:13:10 2014 : Debug: (1) rest : --> http://127.0.0.1:9090
Thu Mar 27 10:13:10 2014 : Debug: /
Thu Mar 27 10:13:10 2014 : Debug: Parsed xlat tree:
Thu Mar 27 10:13:10 2014 : Debug: literal --> /
Thu Mar 27 10:13:10 2014 : Debug: (1) rest : EXPAND /
Thu Mar 27 10:13:10 2014 : Debug: (1) rest : --> /
Thu Mar 27 10:13:10 2014 : Debug: (1) rest : Sending HTTP POST to "http://127.0.0.1:9090/"
Thu Mar 27 10:13:10 2014 : Debug: (1) rest : Request body content-type will be "application/json"
Thu Mar 27 10:13:10 2014 : Debug: (1) rest : Encoding attribute "User-Name"
Thu Mar 27 10:13:10 2014 : Debug: (1) rest : Type : string
Thu Mar 27 10:13:10 2014 : Debug: (1) rest : Length : 3
Thu Mar 27 10:13:10 2014 : Debug: (1) rest : Value : "foo"
Thu Mar 27 10:13:10 2014 : Debug: (1) rest : Encoding attribute "User-Password"
Thu Mar 27 10:13:10 2014 : Debug: (1) rest : Type : string
Thu Mar 27 10:13:10 2014 : Debug: (1) rest : Length : 3
Thu Mar 27 10:13:10 2014 : Debug: (1) rest : Value : "bar"
Thu Mar 27 10:13:10 2014 : Debug: (1) rest : Encoding attribute "NAS-IP-Address"
Thu Mar 27 10:13:10 2014 : Debug: (1) rest : Type : ipaddr
Thu Mar 27 10:13:10 2014 : Debug: (1) rest : Length : 13
Thu Mar 27 10:13:10 2014 : Debug: (1) rest : Value : "192.168.146.1"
Thu Mar 27 10:13:10 2014 : Debug: (1) rest : Encoding attribute "NAS-Port"
Thu Mar 27 10:13:10 2014 : Debug: (1) rest : Type : integer
Thu Mar 27 10:13:10 2014 : Debug: (1) rest : Length : 1
Thu Mar 27 10:13:10 2014 : Debug: (1) rest : Value : 0
Thu Mar 27 10:13:10 2014 : Debug: (1) rest : Encoding attribute "Message-Authenticator"
Thu Mar 27 10:13:10 2014 : Debug: (1) rest : Type : octets
Thu Mar 27 10:13:10 2014 : Debug: (1) rest : Length : 34
Thu Mar 27 10:13:10 2014 : Debug: (1) rest : Value : "0x33bf98942c5ea4eee2466c87dc6558c5"
Thu Mar 27 10:13:10 2014 : Debug: (1) rest : JSON Data: {"User-Name":{"type":"string","value":["foo"]},"User-Password":{"type":"string","value":["bar"]},"NAS-IP-Address":{"type":"ipaddr","value":["192.168.146.1"]},"NAS-Port":{"type":"integer","value":[0]},"Message-Authenticator":{"type":"octets","value":["0x33bf98942c5ea4eee2466c87dc6558c5"]}}
It works fine for me... Could you try the latest v3.0.x HEAD, there's some more code in there to catch invalid (or unsupported) body types, it which might show what's going on.
My config looks like:
authorize {
timeout = 2
uri = "http://127.0.0.1:9090/"
method = "post"
body = "json"
tls = ${..tls}
}
-Arran
Arran Cudbard-Bell <a.cudbardb at freeradius.org>
FreeRADIUS Development Team
FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 881 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freeradius.org/mailman/private/freeradius-users/attachments/20140327/a1916474/attachment.pgp>
More information about the Freeradius-Users
mailing list