[dancer-users] request->user

Russell Jenkins russell.jenkins at strategicdata.com.au
Wed Sep 16 15:06:05 BST 2015


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.



More information about the dancer-users mailing list