From ed3e382ef19aaca807c7adb96d3532eef2e8b1fb Mon Sep 17 00:00:00 2001 From: Valentin Samir Date: Mon, 1 Aug 2016 16:56:41 +0200 Subject: [PATCH] [cas.py] Append renew=true when validating tickets --- cas_server/cas.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cas_server/cas.py b/cas_server/cas.py index 818cf0f..06ce8d2 100644 --- a/cas_server/cas.py +++ b/cas_server/cas.py @@ -154,6 +154,8 @@ class CASClientV1(CASClientBase, ReturnUnicode): Returns username on success and None on failure. """ params = [('ticket', ticket), ('service', self.service_url)] + if self.renew: + params.append(('renew', 'true')) url = (urllib_parse.urljoin(self.server_url, 'validate') + '?' + urllib_parse.urlencode(params)) page = urllib_request.urlopen(url) @@ -187,6 +189,8 @@ class CASClientV2(CASClientBase, ReturnUnicode): def get_verification_response(self, ticket): params = [('ticket', ticket), ('service', self.service_url)] + if self.renew: + params.append(('renew', 'true')) if self.proxy_callback: params.append(('pgtUrl', self.proxy_callback)) base_url = urllib_parse.urljoin(self.server_url, self.url_suffix)