Bearer token - Token propagation to upstream communication #56943
Unanswered
MahendraRaja
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Background
We are attempting to ensure that the Authorization (Bearer) token from client requests is consistently forwarded and available to all downstream services in our Kubernetes/Istio environment. This is required for authentication/authorization at each hop (sidecar β app, service-to-service).
Environment
Kubernetes
Istio
Envoy
What We've Tried
EnvoyFilter: header_to_metadata / metadata_to_header
Approach: Copy Authorization header to dynamic metadata and then back into outbound headers.
Outcome: Inbound copy works, but outbound injection is not reliable. Metadata doesnβt persist across the filter chain as expected.
Lua Filter for Header Propagation
Approach: Use Lua to read the Authorization header and inject it in outbound requests.
Outcome: Lua script can access inbound headers, but does not always have access to the original token for outbound requests, due to Envoy's internal context limitations. Logging confirms header loss after ingress, especially for non-HTTP/1.1 hops.
References
Istio Discuss: Passing Authorization Headers Automatically/JWT Between Microservices
Conclusion / Request
After multiple approaches and extensive testing, it appears there is no robust, transparent, infrastructure-level method to propagate the original Authorization header (Bearer token) across all hops in Istio with current Envoy/Lua capabilities. All solutions either break at the filter chain boundary, lose header context, or require intrusive application code changes.
If any new methods exist, or if Iβve missed something, please advise. Otherwise, we will need to ask all developers to include token propagation as part of the application code.
Beta Was this translation helpful? Give feedback.
All reactions