16 Sep
2015
16 Sep
'15
2:06 p.m.
On 16/09/2015 4:40 pm, arjan wrote:
I expected that Dancer2 would get it from the environment hash %ENV.
request->user is sugar for request->env->{REMOTE_USER} i.e. its passed through to Dancer2 as an entry in the psgi $env hashref. You may want to look at the code for some of the Plack::Middleware::Auth::* modules to see how they populate REMOTE_USER in the psgi env. (Those middleware are typically less that 100 lines.) If you are using nginx, Apache or similar to do basic or digest auth before using a reverse proxy to your app, the proxied request will NOT contain the REMOTE_USER. You'll need to propagate the user in a custom header. Cheers, Russell.