Welcome, Guest
Username: Password: Remember me

TOPIC: Problem trying to get the web server auth running

Problem trying to get the web server auth running 1 year 21 hours ago #94925

  • jowen
  • jowen's Avatar
  • Fresh Lemon
  • Posts: 1
  • Karma: 0
I have recently been using your product and think it is great. I am not new to PHP however have been really struggling to get the web server authentication to work. I have read the docs and while this subject is spoken about I just need some help to get it running.

I am authenticating all users via a MYSQL database login form and not via HTTP. I planned to use cURL to call lime survey. My code I have been using is below and it simply is not working. I think the issue I am having is passing the authenticated user.

Am I completely off the mark for this integration or is there something very minor I am missing?
The build I am using is the latest stable release 200 build number 130406

Thanks in advance
$cred = "user";
$data = array();
$data[] = "Authorization: Basic ". base64_encode($cred);
$ch = curl_init(); 
$timeout = 30;
curl_setopt($ch, CURLOPT_URL, $request_url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_HTTPHEADER, $data); 
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
curl_setopt($ch, CURLOPT_UNRESTRICTED_AUTH, 1);  
$output = curl_exec($ch);
if ($output === FALSE) {  
echo "cURL Error: " . curl_error($ch);    
echo $output;
The administrator has disabled public write access.

Problem trying to get the web server auth running 1 year 19 hours ago #94927

  • mdekker
  • mdekker's Avatar
  • LimeSurvey Team
  • Posts: 340
  • Thank you received: 68
  • Karma: 38
You don't need to do php coding if you use webserver authentication: the webserver handles that for you when configured right. Google on "apache auth mysql" to get some info on how to set this up.

If you want to authenticate in limesurvey via a different mysql database then the one limesurvey uses, you should wait for 2.05 (which is beta now) and write a different authentication plugin.
Menno Dekker
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.162 seconds
Donation Image