CAS parameters

ronpeterson - September 16, 2008 - 19:44
Project:CAS
Version:HEAD
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review
Description

I need to include the parameter renew=true to authentic against our CAS server. I've looked all over, but I don't see any way to do that. Does anyone know how to do set up that parameter in Drupal?

Thanks.

#1

metzlerd - September 18, 2008 - 02:59

It is not something that is supported in the current version of the cas module. Patches are welcome here.

Dave

#2

ronpeterson - October 28, 2008 - 21:04
Status:active» needs review

To address the problem I added a new checkbox in the CAS settings:

$form['server']['cas_renew'] = array (
'#type' => 'checkbox',
'#title' => t('Force renew'),
'#default_value' => variable_get('cas_renew', 0),
'#description' => t('Check this box if you require users to renew their credentials when they login to Drupal using CAS. Or if your CAS server is configured to require the renew=true parameter.'),
);

And then if the checkbox is checked I add the renew parameter to the URL and use phpCAS::setServerLoginUrl() to update the URL used by phpCAS::forceAuthentication()

if (is_callable(array(phpCAS,'authenticateIfNeeded')))
{
phpCAS::authenticateIfNeeded();
}
else
{
// If Force Renew is checked, add renew parameter to Server Login URL
if ($cas_renew != 0) {
$ServerLoginUrl = phpCAS::getServerLoginUrl()."&renew=true";
phpCAS::setServerLoginUrl($ServerLoginUrl);
}

phpCAS::forceAuthentication();

}

I didn't use phpCAS::renewAuthentication() because it only includes the renew parameter if the user is already authenticated and the CAS server I am using for authentication requires the renew parameter for all requests.

See attached for updated file.

AttachmentSize
cas.module.patch 26.81 KB

#3

metzlerd - June 2, 2009 - 15:41

FYI: The reason that this hasn't gone anywhere is that this is not in patch format, but rather includes the whole module. I'll try and integrate this functionality if I have time, but it would be great if you created a regular patch from the HEAD CVS file. See the Handbooks for more information about how to do this.

#4

metzlerd - June 2, 2009 - 15:41
Component:Documentation» Code
Category:task» feature request
Status:needs review» needs work

#5

spenserj - July 28, 2009 - 21:20
Version:6.x-1.0» HEAD
Status:needs work» needs review

Here is a proper patch against the HEAD

AttachmentSize
cas.309352.patch 1.8 KB
 
 

Drupal is a registered trademark of Dries Buytaert.