On 22/03/13 11:46 Robert Rothenberg wrote:

> I understand how to have an Apache reverse proxy send the REMOTE_USER as a
> header, with something like
> 
>   RequestHeader set X-Proxy-REMOTE-USER %{REMOTE_USER}
> 
> but how to I get Authentication::Credential::Remote to use the header
> instead of the environment variable?  Do I need an auto method in Root.pm
> that checks for the header and sets $c->req->remote_user()?

I have code such as

    if (my $user = $c->req->header('X-Proxy-REMOTE-USER')) {

        $c->engine->env({ REMOTE_USER => $user });

        $c->authenticate({});

    }

which works, but I get a warning "env as a writer is deprecated, you
probably need to upgrade Catalyst::Engine::PSGI".

I'm unsure what to do here. Should I write a Plack::Middleware plugin that
translates the X-Proxy-REMOTE_USER header to an env->{REMOTE_USER}?




_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Reply via email to