Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:
  • Seite:
  • 1
  • 2

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

CAS-ifying LimeSurvey 2.0 (the dirty way) 2 Jahre 2 Wochen her #92652

  • Adrax
  • Adraxs Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 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.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

CAS-ifying LimeSurvey 2.0 (the dirty way) 3 Monate 1 Tag her #115066

  • plegrand1
  • plegrand1s Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 17
  • 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
Der Administrator hat öffentliche Schreibrechte deaktiviert.

CAS-ifying LimeSurvey 2.0 (the dirty way) 3 Monate 1 Tag her #115067

  • Adrax
  • Adraxs Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 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.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

CAS-ifying LimeSurvey 2.0 (the dirty way) 3 Monate 1 Tag her #115068

  • plegrand1
  • plegrand1s Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 17
  • 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 ?
Letzte Änderung: 3 Monate 1 Tag her von plegrand1.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

CAS-ifying LimeSurvey 2.0 (the dirty way) 3 Monate 1 Tag her #115069

  • Adrax
  • Adraxs Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 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.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

CAS-ifying LimeSurvey 2.0 (the dirty way) 3 Monate 1 Tag her #115071

  • plegrand1
  • plegrand1s Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 17
  • 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 ?
Der Administrator hat öffentliche Schreibrechte deaktiviert.

CAS-ifying LimeSurvey 2.0 (the dirty way) 3 Monate 1 Tag her #115072

  • Adrax
  • Adraxs Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 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.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

CAS-ifying LimeSurvey 2.0 (the dirty way) 3 Monate 1 Tag her #115073

  • plegrand1
  • plegrand1s Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 17
  • Karma: 0
as you say i think i'm using limesurvey credentials, i think i done what you told to do
Der Administrator hat öffentliche Schreibrechte deaktiviert.

CAS-ifying LimeSurvey 2.0 (the dirty way) 3 Monate 1 Tag her #115074

  • Adrax
  • Adraxs Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 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.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

CAS-ifying LimeSurvey 2.0 (the dirty way) 3 Monate 1 Tag her #115075

  • plegrand1
  • plegrand1s Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 17
  • Karma: 0
i'm using Version 2.05+ Build 141123
Der Administrator hat öffentliche Schreibrechte deaktiviert.
  • Seite:
  • 1
  • 2
Moderatoren: ITEd
Ladezeit der Seite: 0.223 Sekunden
Donation Image