Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG  Not logged in ELOG logo
icon1.gif   Use X-Forwarded-User as preset in author field, posted by Stefano Lacaprara on Tue May 16 10:21:18 2017 
    icon2.gif   Re: Use X-Forwarded-User as preset in author field, posted by Christof Hanke on Wed May 17 08:42:17 2017 
       icon2.gif   Re: Use X-Forwarded-User as preset in author field, posted by Stefano Lacaprara on Thu May 18 09:39:16 2017 
          icon2.gif   Re: Use X-Forwarded-User as preset in author field, posted by Christof Hanke on Thu May 18 10:37:16 2017 
             icon2.gif   Re: Use X-Forwarded-User as preset in author field, posted by Christof Hanke on Thu May 18 10:51:05 2017 
                icon2.gif   [solved] Re: Use X-Forwarded-User as preset in author field, posted by Stefano Lacaprara on Thu May 18 16:55:42 2017 
Message ID: 68621     Entry time: Wed May 17 08:42:17 2017     In reply to: 68620     Reply to this: 68622
Icon: Reply  Author: Christof Hanke  Author Email: hanke@rzg.mpg.de 
Category: Question  OS: Linux  ELOG Version: 3.1.1 
Subject: Re: Use X-Forwarded-User as preset in author field 
> Hi,
>   I have an elog server which uses apache/ldap for authentication.
> I would like to have the username used for ldap to be set automatically as author field in the elog.
> 
> I'm using: 
> Authentication = Webserver
> and I do set the env-variable X-Forwarded-User correctly to the ldap username
> 
> GET /test/?cmd=New HTTP/1.1
> Host: localhost:8080
> Authorization: Basic bGFjYXByYXI6TWEwMiSyYnVt
> ...
> Cookie: elmode=Summary; sid=D7DE678B7CAA1D10; ufnm=lacaprar; urem=0
> ...
> X-Forwarded-User: lacaprar
> 
> How can I preset author to X-Forwarded-User?
> Preset Author = $??
> I've tried $short_name/$long_name but I got Anonymous.
> I understand that it is so because these are meant to be filled when password authentication is used: any way to use some other variable with the Webserver auth?
> 
> thanks in advance,
>   Stefano


Hi,

I use an older version of elog, but
 
Preset Author = $short_name <$long_name>

works for me.

One thing to note is that I also have :
Self register = 1

So at first login, the user has to type in his name and email adress,
maybe that's why you got "Anonymous". (Otherwise the variable $shortname etc. are not set.)

HTH,

Christof
ELOG V3.1.5-fe60aaf