3

I want to add some headers to my incoming rest api requests with kong gateway. In the kong admin UI, I set these parametes :

config.add.headers: myheader: $(consumer_id)

myheader is a name for new header and I want to set variable of consumer_id value in these header. but after this configuration , kong gives me a empty value. I also tried ${consumer_id} and etc ... but none of these variables worked.!

So the question is: what's the VARIABLE syntaxs of consumer_id or custom_id and ... too call in kong gateway.

thx BR

Ôrel
7,7504 gold badges32 silver badges51 bronze badges
asked Apr 26, 2022 at 13:45
3
  • 1
    Are you using Key Authentication plugin ? X-Consumer-ID should be already set Commented Apr 27, 2022 at 14:20
  • are you using the OSS request transformer plugin (docs.konghq.com/hub/kong-inc/request-transformer) or some other plugin specific for Kong Enterprise like Request Transformer Advanced? Commented May 7, 2022 at 22:18
  • have you tried consumer.id instead of consumer_id? Commented May 7, 2022 at 22:19

1 Answer 1

1

finally I found the correct header from network dump, and replace it with My required header.

the right header for my case was : X-Consumer-Custom-ID

answered May 8, 2022 at 11:29
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.