@@ -30,6 +30,7 @@ def __init__(
30
30
self ,
31
31
server_url ,
32
32
service_url = None ,
33
+ validate_url = None ,
33
34
auth_prefix = '/cas' ,
34
35
proxy_url = None ,
35
36
proxy_callback = None ,
@@ -42,6 +43,7 @@ def __init__(
42
43
self ._proxy_url = proxy_url
43
44
self ._server_url = server_url
44
45
self ._service_url = service_url
46
+ self ._validate_url = validate_url or server_url
45
47
self ._session_storage_adapter = session_storage_adapter
46
48
self ._verify_certificates = bool (verify_certificates )
47
49
self ._headers = headers
@@ -398,22 +400,22 @@ def _get_proxy_url(self, ticket):
398
400
return url
399
401
400
402
def _get_proxy_validate_url (self , ticket ):
401
- template = '{server_url }{auth_prefix}/proxy?'
403
+ template = '{validate_url }{auth_prefix}/proxy?'
402
404
template += 'ticket={ticket}&service={proxy_callback}'
403
405
url = template .format (
404
406
auth_prefix = self .auth_prefix ,
405
407
proxy_callback = self .proxy_callback ,
406
- server_url = self .server_url ,
408
+ validate = self .validate_url ,
407
409
ticket = ticket ,
408
410
)
409
411
return url
410
412
411
413
def _get_service_validate_url (self , ticket , service_url = None ):
412
- template = '{server_url }{auth_prefix}/serviceValidate?'
414
+ template = '{validate_url }{auth_prefix}/serviceValidate?'
413
415
template += 'ticket={ticket}&service={service_url}'
414
416
url = template .format (
415
417
auth_prefix = self .auth_prefix ,
416
- server_url = self .server_url ,
418
+ validate_url = self .validate_url ,
417
419
service_url = service_url or self .service_url ,
418
420
ticket = ticket ,
419
421
)
@@ -507,6 +509,16 @@ def session_storage_adapter(self):
507
509
'''
508
510
return self ._session_storage_adapter
509
511
512
+ @property
513
+ def validate_url (self ):
514
+ '''
515
+ The CAS client's validation URL.
516
+
517
+ Defaults to the server_url, should only be set if using a separate
518
+ hostname for internal calls to /validateService.
519
+ '''
520
+ return self ._validate_url
521
+
510
522
@property
511
523
def verify_certificates (self ):
512
524
'''
0 commit comments