Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG  Not logged in ELOG logo
icon5.gif   command line and apache+ldap authentication, posted by Stefano Lacaprara on Thu Apr 6 17:36:46 2017 
    icon2.gif   Re: command line and apache+ldap authentication, posted by Stefan Ritt on Fri Apr 7 12:16:24 2017 
Message ID: 68597     Entry time: Fri Apr 7 12:16:24 2017     In reply to: 68592
Icon: Reply  Author: Stefan Ritt  Author Email: stefan.ritt@psi.ch 
Category: Question  OS: Linux  ELOG Version: 3.1.1 
Subject: Re: command line and apache+ldap authentication 

Hi, the elog command line client does not know anything about Apache authentication, therefore the authentication with the elog username/password fails. As an alternative to the command line client you can use the "curl" utility (available under Linux). This tools has the "-u" flag, which works with Apache. The tricky thing is now to "emulate" your browser submitting an entry. You can do

$ curl -u <username>:<password> -F cmd=Submit -F Author=CURL -F Text="This is the CURL text" http://<your host>:8080/<logbook>

(of course your attributes might be different than "Author"). If you have a multiline text body, you can read that from a file (in this case "file.txt"):

$ curl -u <username>:<password> -F cmd=Submit -F Author=CURL -F Text="@file.txt" http://<your host>:8080/<logbook>

When I wrote "elog" orginiallly (199x?), "curl" was not available or at least I didn't know of. Right now it almoste completely can replace the elog tool.

Stefan

ELOG V3.1.5-fe60aaf