Thank you Russell! This is very helpful. On 09/16/2015 04:06 PM, Russell Jenkins wrote:
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.
_______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
-- Met vriendelijke groet, Arjan Widlak Bezoek onze site op: http://www.unitedknowledge.nl De rijkshuisstijl, ook voor tablet en iPhone: http://www.rijkshuisstijl.unitedknowledge.nl/ United Knowledge, inhoud en techniek Bilderdijkstraat 79N 1053 KM Amsterdam T +31 (0)20 737 1851 F +31 (0)84 877 0399 bureau@unitedknowledge.nl http://www.unitedknowledge.nl M +31 (0)6 2427 1444 E arjan@unitedknowledge.nl We use WebGUI, the Open Source CMS http://www.webgui.org/