Skip to content

Commit 1cbaf03

Browse files
author
Guillaume Rousse
committed
make metadata endpoints configurable as others
Rather have a working metadata exposure endpoint registration, whatever base url is, than try to deduce it from entityID.
1 parent 959544c commit 1cbaf03

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

example/plugins/backends/saml2_backend.yaml.example

+2
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ config:
6666
- [<name>/acs/post, 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST']
6767
discovery_response:
6868
- [<name>/disco, 'urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol']
69+
metadata_exposal: <name>/proxy_saml2_backend.xml
70+
metadata_reload: <name>/reload-metadata
6971

7072
# name_id_format: a list of strings to set the <NameIDFormat> element in SP metadata
7173
# name_id_policy_format: a string to set the Format attribute in the NameIDPolicy element

src/satosa/backends/saml2.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -611,14 +611,12 @@ def register_endpoints(self):
611611
("^%s$" % endp, self.disco_response))
612612

613613
if self.expose_entityid_endpoint():
614-
logger.debug("Exposing backend entity endpoint = {}".format(self.sp.config.entityid))
615-
parsed_entity_id = urlparse(self.sp.config.entityid)
616-
url_map.append(("^{0}".format(parsed_entity_id.path[1:]),
617-
self._metadata_endpoint))
614+
url_map.append(
615+
("^%s$" % sp_endpoints["metadata_exposal"], self._metadata_endpoint))
618616

619617
if self.enable_metadata_reload():
620618
url_map.append(
621-
("^%s/%s$" % (self.name, "reload-metadata"), self._reload_metadata))
619+
("^%s$" % sp_endpoints["metadata_reload"], self._reload_metadata))
622620

623621
logger.debug(f"Loaded SAML2 endpoints: {url_map}")
624622
return url_map

0 commit comments

Comments
 (0)