rlm_rest: Authentication by token?
Hi, In the documentation of rlm_rest I see several auth methods documented. My REST API works with a header field where a token is passed: something like: curl -H "Authorization: Token $TOKEN" Is there a simple way to configure the rest module to generate this header or do I have to do something like: update control { REST-HTTP-Header := "Authorization: Token 0x123245678" } Mit freundlichen Grüßen, -- [*] sys4 AG https://sys4.de, +49 (89) 30 90 46 64 Schleißheimer Straße 26/MG,80333 München Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263 Vorstand: Patrick Ben Koetter, Marc Schiffbauer, Wolfgang Stief Aufsichtsratsvorsitzender: Florian Kirstein
Hi
Hi,
In the documentation of rlm_rest I see several auth methods documented. My REST API works with a header field where a token is passed:
something like: curl -H "Authorization: Token $TOKEN"
Is there a simple way to configure the rest module to generate this header or do I have to do something like:
update control {
REST-HTTP-Header := "Authorization: Token 0x123245678”
}
For sure, that is the way.
On Dec 18, 2021, at 9:35 AM, Michael Schwartzkopff <ms@sys4.de> wrote:
Is there a simple way to configure the rest module to generate this header or do I have to do something like:
update control {
REST-HTTP-Header := "Authorization: Token 0x123245678"
}
Just put that before every use of the "rest" module. Or, you can use policies and over-ride the rest module! Add a file raddb/policy.d/rest, with contents: rest.authorize { update control { REST-HTTP-Header := "Authorization: Token 0x123245678" } rest } Then every time you use just "rest" in the "authorize" section, the server will magically run that policy. It's very handy for this kind of situation. Alan DeKok.
participants (3)
-
Alan DeKok -
Jorge Pereira -
Michael Schwartzkopff