@@ -209,7 +209,7 @@ def disco_query(self, context):
209
209
:return: Response
210
210
"""
211
211
endpoints = self .sp .config .getattr ("endpoints" , "sp" )
212
- return_url = endpoints ["discovery_response" ][0 ][0 ]
212
+ return_url = "{}/{}" . format ( self . base_url , endpoints ["discovery_response" ][0 ][0 ])
213
213
214
214
disco_url = (
215
215
context .get_decoration (SAMLBackend .KEY_SAML_DISCOVERY_SERVICE_URL )
@@ -303,10 +303,11 @@ def authn_request(self, context, entity_id):
303
303
304
304
try :
305
305
acs_endp , response_binding = self ._get_acs (context )
306
+ acs_endp_url = "{}/{}" .format (self .base_url , acs_endp )
306
307
relay_state = util .rndstr ()
307
308
req_id , binding , http_info = self .sp .prepare_for_negotiated_authenticate (
308
309
entityid = entity_id ,
309
- assertion_consumer_service_url = acs_endp ,
310
+ assertion_consumer_service_url = acs_endp_url ,
310
311
response_binding = response_binding ,
311
312
relay_state = relay_state ,
312
313
** kwargs ,
@@ -588,8 +589,7 @@ def register_endpoints(self):
588
589
url_map = []
589
590
sp_endpoints = self .sp .config .getattr ("endpoints" , "sp" )
590
591
for endp , binding in sp_endpoints ["assertion_consumer_service" ]:
591
- parsed_endp = urlparse (endp )
592
- url_map .append (("^%s$" % parsed_endp .path [1 :], functools .partial (self .authn_response , binding = binding )))
592
+ url_map .append (("^%s$" % endp , functools .partial (self .authn_response , binding = binding )))
593
593
if binding == BINDING_HTTP_REDIRECT :
594
594
msg = " " .join (
595
595
[
@@ -607,9 +607,8 @@ def register_endpoints(self):
607
607
608
608
if self .discosrv :
609
609
for endp , binding in sp_endpoints ["discovery_response" ]:
610
- parsed_endp = urlparse (endp )
611
610
url_map .append (
612
- ("^%s$" % parsed_endp . path [ 1 :] , self .disco_response ))
611
+ ("^%s$" % endp , self .disco_response ))
613
612
614
613
if self .expose_entityid_endpoint ():
615
614
logger .debug ("Exposing backend entity endpoint = {}" .format (self .sp .config .entityid ))
@@ -621,6 +620,7 @@ def register_endpoints(self):
621
620
url_map .append (
622
621
("^%s/%s$" % (self .name , "reload-metadata" ), self ._reload_metadata ))
623
622
623
+ logger .debug (f"Loaded SAML2 endpoints: { url_map } " )
624
624
return url_map
625
625
626
626
def _reload_metadata (self , context ):
0 commit comments