Closed dmarko484 closed 6 years ago
Hi, Charon proxies the whole requests, including HTTP headers, so you can add the authentication header to the request that must be proxied by Charon. Currently there is no support for adding custom headers to the forwarded request. Let me know if you definitely need such a feature and I will implement it.
Thanks for info. my scenario is like this:
You say "Charon proxies the whole requests, including HTTP headers, so you can add the authentication header to the request that must be proxied by Charon." ... How can I do it prior request is proxied to backround service(Grafana)?
Ok, I understand now, you need a support for adding custom headers on Charon level. There is no such feature for now, I will implement it and let you know.
Unbelievable ... Thanks!
I have released new 2.2.0 version of Charon which is capable of resolving your issue, see: https://github.com/mkopylec/charon-spring-boot-starter#forwarded-request-intercepting To add your authorization header:
@Component
public class CustomForwardedRequestInterceptor implements ForwardedRequestInterceptor {
@Override
public void intercept(RequestData data) {
data.getHeaders().set("X-WEBAUTH-USER", ...);
}
}
Please close the issue if your problem is solved now.
It's working great! Thanks a lot!
We would like to integrate Grafana using 'authproxy' feature with our SpringBoot app see https://grafana.com/blog/2015/12/07/grafana-authproxy-have-it-your-way/ ... to share authentication Grafana requires custom header (X-WEBAUTH-USER) to be forwarder with proxied request. Is there a way how to add custom header like this?