From: Simo Sorce Date: Mon, 7 Apr 2014 22:41:12 +0000 (-0400) Subject: Return Idps metadata file on request X-Git-Tag: v0.2.2~35 X-Git-Url: http://git.cascardo.info/?p=cascardo%2Fipsilon.git;a=commitdiff_plain;h=97b2ba92e574e401b737486fe0ac9833649e2702 Return Idps metadata file on request Signed-off-by: Simo Sorce --- diff --git a/ipsilon/providers/saml2idp.py b/ipsilon/providers/saml2idp.py index f37474d..0c8358d 100755 --- a/ipsilon/providers/saml2idp.py +++ b/ipsilon/providers/saml2idp.py @@ -98,10 +98,21 @@ class SSO(ProviderPageBase): self.Continue = Continue(*args, **kwargs) +class Metadata(ProviderPageBase): + def GET(self, *args, **kwargs): + with open(self.cfg.idp_metadata_file) as m: + body = m.read() + cherrypy.response.headers["Content-Type"] = "text/xml" + cherrypy.response.headers["Content-Disposition"] = \ + 'attachment; filename="metadata.xml"' + return body + + class SAML2(ProviderPageBase): def __init__(self, *args, **kwargs): super(SAML2, self).__init__(*args, **kwargs) + self.metadata = Metadata(*args, **kwargs) # Init IDP data try: