I’m trying to write an authentication provider that accepts JWTs, so I can connect to HA through my Pomerium instance.
For it to work I need to be able to access the request headers so I can read the JWT and then perform validation.
As far as I understand it, the headers are actually saved to “a Context” by
http.request_context (here), but when I print out
context (the different one passed to
async_login_flow) in a devcontainer all I get is
ip_address: 192.168.x.x credential_only: False redirect_uri: http://192.168.x.x:8123/?auth_callback=1
I tried dumping different objects (among them
async_login_flow, to no avail: I cannot find neither request headers, nor the
aiohttp.web.Request object that’s supposed to contain them.
Does anyone have any idea where I should look, or if there’s a way to access the middleware data, or how is the authentication provider’s context
dict built so I can maybe try to add those headers back?
Side note: I’m aware of this thread and the corresponding feature request, but AFAICT there hasn’t been any progress yet.