I set up OAuth2-proxy as a reverse proxy, providing authentication and authorization for users of a custom web application, deployed as an upstream private service. It all works well. Except that I would like to pass the username from the reverse proxy to the upstream application.
The OAuth2-proxy documentation suggests that username can be passed from the reverse proxy as the HTTP header X-Forwarded-User. But how can my upstream application receive that HTTP header? The upstream application is in Python, so I looked at the requests package, but that package seems to only provide headers for an outbound request made by the application, or the response to that outbound request.
What am I missing?