summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2014-04-07 18:41:12 -0400
committerSimo Sorce <simo@redhat.com>2014-04-11 17:25:54 -0400
commit97b2ba92e574e401b737486fe0ac9833649e2702 (patch)
treec5e902554acbaf37ee4c2f39c720aaad5c36bc14
parent1110691b872a704bf02dd29b7c1437cfcdf62109 (diff)
downloadipsilon-97b2ba92e574e401b737486fe0ac9833649e2702.tar.gz
ipsilon-97b2ba92e574e401b737486fe0ac9833649e2702.tar.xz
ipsilon-97b2ba92e574e401b737486fe0ac9833649e2702.zip
Return Idps metadata file on request
Signed-off-by: Simo Sorce <simo@redhat.com>
-rwxr-xr-xipsilon/providers/saml2idp.py11
1 files changed, 11 insertions, 0 deletions
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: