lua-resty-openidc icon indicating copy to clipboard operation
lua-resty-openidc copied to clipboard

Correlation IDs in introspect flow

Open bhedia opened this issue 3 years ago • 1 comments

Hello,

Is it possible to configure the OIDC library to allow forwarding a correlation ID to the OIDC provider from Kong (from the incoming request) in the introspect flow?

That way, if there is a failure in the introspection, internal engineers can use the correlation ID to track where the request failed, and why.

bhedia avatar Sep 21 '22 04:09 bhedia

Yes, you can use http_request_decorator for that. In fact this is exactly the use case I wanted this to be added in the past, see #199

Something like

    http_request_decorator = function(req)
      local h = req.headers or {}
      h['correlation-id'] = 'my correlation id'
      req.headers = h
      return req
    end

should do.

bodewig avatar Sep 25 '22 12:09 bodewig