[RADIATOR] TraceId with AuthBy REST?

Heikki Vatiainen hvn at open.com.au
Wed Dec 14 17:01:27 UTC 2022

On 28.11.2022 18.43, C R via radiator wrote:

> Another question about AuthBy REST. I wonder if the logged TraceId can
> be sent to the remote REST service doing the actual authentication. I
> am refactoring the service and I see I can easily retrieve a traceid
> from the call if it's added to the request's header, eg:
> curl -H "X-Request-ID: 3" "http://localhost:1323/?my=param"
> It's not a must-have but maybe handy when debugging logs from Radiator
> and the REST service. Before I jump in the source and find a
> non-supported way to retrieve the logged TraceId (maybe), it may be a
> good idea to ask first.

It seems there's no clear way to do this currently. Something similar 
that's possible with URL formatting can be added. It could even be done 
by quite similar method too. At the moment request headers can be 
configured, but they are simply static with no run-time formatting.

The unclear way would be to use HTTP_AuthenticationHook, get the handle 
to current request from somewhere, it's not passed to the hook, and then 
use HTTP::Request's header() method to add 'X-Request-ID' and the 
possible authentication headers.

I'd say a better method is to add support for headers that can be 
optionally formatted, or possibly a hook for more flexible header handling.


Heikki Vatiainen
OSC, makers of Radiator
Visit radiatorsoftware.com for Radiator AAA server software

More information about the radiator mailing list