Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: CAS-ifying LimeSurvey 2.0 (the dirty way)

CAS-ifying LimeSurvey 2.0 (the dirty way) 2 years 1 month ago #92652

  • Adrax
  • Adrax's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 11
  • Karma: 0
I've looking for an official way to CAS-authenticate the admin pages of LimeSurvey, but couldn't find anything suitable.

This is a quick and dirty way to do so. It just "cheats" the app into thinking that the authentication is web server based.

1- First of all download the phpCAS client library into /third_party/CAS.

2- Modify /application/config/config.php:
$config => array(
...
,'auth_webserver'=>true
,'auth_cas'=>true
,'cas_settings'=>array(
	'casAuthServer' => 'my_cas_server.my_site.com',
	'casAuthPort' => 443,
	'casAuthUri' => '/cas-auth-service-uri/'
);
(change the parameters accordingly)

3- Modify /application/core/UserIdentity.php:
(At the beginning of the "authenticate" function, inside of it)
if (Yii::app()->getConfig("auth_cas") == true && (empty($_SERVER['PHP_AUTH_USER']) || empty($_SERVER['LOGON_USER']))) 
{
	require_once Yii::app()->getConfig("rootdir") . DIRECTORY_SEPARATOR . 'third_party' . DIRECTORY_SEPARATOR . 'CAS' . DIRECTORY_SEPARATOR . 'CAS.php';
 
	$cas_settings = Yii::app()->getConfig('cas_settings');
	phpCAS::client(CAS_VERSION_2_0, $cas_settings['casAuthServer'], $cas_settings['casAuthPort'], $cas_settings['casAuthUri'], false);
	phpCAS::setNoCasServerValidation();
	phpCAS::forceAuthentication();
 
	$_SERVER['PHP_AUTH_USER'] = $_SERVER['LOGON_USER'] = phpCAS::getUser();
}

As I said, this is just a workaround. If the developers wish, it could be easily improved.

Any suggestions are welcome.
The administrator has disabled public write access.

CAS-ifying LimeSurvey 2.0 (the dirty way) 3 months 4 weeks ago #115066

  • plegrand1
  • plegrand1's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 19
  • Karma: 0
Hello, i'm trying your solution to CAS-ifying LimeSurvey and i cant make it works. Does that means that as LDAP authentication, user has to exist into limesurvey database ?

Thanks for your help
The administrator has disabled public write access.

CAS-ifying LimeSurvey 2.0 (the dirty way) 3 months 4 weeks ago #115067

  • Adrax
  • Adrax's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 11
  • Karma: 0
CAS authentication is not LDAP authentication, although it usually has a LDAP user repository behind it. User authenticated by CAS must exist in the Limesurvey database.
The administrator has disabled public write access.

CAS-ifying LimeSurvey 2.0 (the dirty way) 3 months 4 weeks ago #115068

  • plegrand1
  • plegrand1's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 19
  • Karma: 0
Thanks a lot for your quick answer !!
and sorry for my poor englih ;-)
But, if the user must exist in limesurvey database, i cant understand the interest of cas authentication ?
thanks again

I just made a try with user existing in db and i can login but i cant see any traffic to the server cas
Do i have to enable webauth plugin ?
Last Edit: 3 months 4 weeks ago by plegrand1.
The administrator has disabled public write access.

CAS-ifying LimeSurvey 2.0 (the dirty way) 3 months 4 weeks ago #115069

  • Adrax
  • Adrax's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 11
  • Karma: 0
CAS is a Single Sign On application. Users can validate at any casified application with just one user and password and a single login. Users must exist in Limesurvey, but their Limesurvey passwords are ignored.
The administrator has disabled public write access.

CAS-ifying LimeSurvey 2.0 (the dirty way) 3 months 4 weeks ago #115071

  • plegrand1
  • plegrand1's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 19
  • Karma: 0
I just made a try with user existing in db and i can login but i cant see any traffic to the server cas
Do i have to enable webauth plugin ?
The administrator has disabled public write access.

CAS-ifying LimeSurvey 2.0 (the dirty way) 3 months 4 weeks ago #115072

  • Adrax
  • Adrax's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 11
  • Karma: 0
If there is no traffic with the CAS server, you must be using your local Limesurvey credentials and you did't patch the code correctly.
The administrator has disabled public write access.

CAS-ifying LimeSurvey 2.0 (the dirty way) 3 months 4 weeks ago #115073

  • plegrand1
  • plegrand1's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 19
  • Karma: 0
as you say i think i'm using limesurvey credentials, i think i done what you told to do
The administrator has disabled public write access.

CAS-ifying LimeSurvey 2.0 (the dirty way) 3 months 4 weeks ago #115074

  • Adrax
  • Adrax's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 11
  • Karma: 0
I don't know, I did this modification some time ago. Maybe you're using a different version and the code needs to be adapted.
The administrator has disabled public write access.

CAS-ifying LimeSurvey 2.0 (the dirty way) 3 months 4 weeks ago #115075

  • plegrand1
  • plegrand1's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 19
  • Karma: 0
i'm using Version 2.05+ Build 141123
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.189 seconds
Donation Image