From 80f695415170c82f6a1dacc95e7bd03777415ddb Mon Sep 17 00:00:00 2001 From: Floris Date: Thu, 7 May 2020 23:22:35 +0200 Subject: [PATCH] Print NameIDFormat in metadata.xml This should solve #21 (I think). --- flask_saml2/sp/sp.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/flask_saml2/sp/sp.py b/flask_saml2/sp/sp.py index 7535958..72bec2e 100644 --- a/flask_saml2/sp/sp.py +++ b/flask_saml2/sp/sp.py @@ -85,6 +85,10 @@ def get_sp_entity_id(self) -> str: """ return self.get_metadata_url() + def get_nameid_format(self) -> str: + """Get the NameIDFormat for this SP.""" + return self.get_sp_config().get('nameid_format') + def get_sp_certificate(self) -> Optional[X509]: """Get the public certificate for this SP.""" return self.get_sp_config().get('certificate') @@ -302,6 +306,7 @@ def get_metadata_context(self) -> dict: 'acs_url': self.get_acs_url(), 'entity_id': self.get_sp_entity_id(), 'certificate': certificate_to_string(self.get_sp_certificate()), + 'nameid_format': self.get_nameid_format(), 'org': None, 'contacts': [], }