Commit ed3e382e authored by Valentin Samir's avatar Valentin Samir

[cas.py] Append renew=true when validating tickets

parent 2a1c9096
...@@ -154,6 +154,8 @@ class CASClientV1(CASClientBase, ReturnUnicode): ...@@ -154,6 +154,8 @@ class CASClientV1(CASClientBase, ReturnUnicode):
Returns username on success and None on failure. Returns username on success and None on failure.
""" """
params = [('ticket', ticket), ('service', self.service_url)] params = [('ticket', ticket), ('service', self.service_url)]
if self.renew:
params.append(('renew', 'true'))
url = (urllib_parse.urljoin(self.server_url, 'validate') + '?' + url = (urllib_parse.urljoin(self.server_url, 'validate') + '?' +
urllib_parse.urlencode(params)) urllib_parse.urlencode(params))
page = urllib_request.urlopen(url) page = urllib_request.urlopen(url)
...@@ -187,6 +189,8 @@ class CASClientV2(CASClientBase, ReturnUnicode): ...@@ -187,6 +189,8 @@ class CASClientV2(CASClientBase, ReturnUnicode):
def get_verification_response(self, ticket): def get_verification_response(self, ticket):
params = [('ticket', ticket), ('service', self.service_url)] params = [('ticket', ticket), ('service', self.service_url)]
if self.renew:
params.append(('renew', 'true'))
if self.proxy_callback: if self.proxy_callback:
params.append(('pgtUrl', self.proxy_callback)) params.append(('pgtUrl', self.proxy_callback))
base_url = urllib_parse.urljoin(self.server_url, self.url_suffix) base_url = urllib_parse.urljoin(self.server_url, self.url_suffix)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment