Skip to content

Commit

Permalink
make metadata endpoints configurable as others
Browse files Browse the repository at this point in the history
Rather have a working metadata exposure endpoint registration, whatever base url is,
than try to deduce it from entityID.
  • Loading branch information
Guillaume Rousse committed Jan 22, 2025
1 parent a4147e0 commit ee5c0a9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 2 additions & 0 deletions example/plugins/backends/saml2_backend.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ config:
- [<name>/acs/post, 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST']
discovery_response:
- [<name>/disco, 'urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol']
metadata_exposal: <name>/proxy_saml2_backend.xml
metadata_reload: <name>/reload-metadata

# name_id_format: a list of strings to set the <NameIDFormat> element in SP metadata
# name_id_policy_format: a string to set the Format attribute in the NameIDPolicy element
Expand Down
8 changes: 3 additions & 5 deletions src/satosa/backends/saml2.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,14 +611,12 @@ def register_endpoints(self):
("^%s$" % endp, self.disco_response))

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

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

logger.debug(f"Loaded SAML2 endpoints: {url_map}")
return url_map
Expand Down

0 comments on commit ee5c0a9

Please sign in to comment.