Declare admin attribute
[cascardo/ipsilon.git] / ipsilon / providers / saml2idp.py
index c7ef939..a1247d5 100755 (executable)
@@ -141,6 +141,7 @@ class IdpProvider(ProviderBase):
 
     def __init__(self):
         super(IdpProvider, self).__init__('saml2', 'saml2')
 
     def __init__(self):
         super(IdpProvider, self).__init__('saml2', 'saml2')
+        self.admin = None
         self.page = None
         self.idp = None
         self.description = """
         self.page = None
         self.idp = None
         self.description = """
@@ -261,14 +262,17 @@ class Installer(object):
         cert.generate('idp', opts['hostname'])
 
         # Generate Idp Metadata
         cert.generate('idp', opts['hostname'])
 
         # Generate Idp Metadata
-        url = 'https://' + opts['hostname'] + '/' + opts['instance'] + '/saml2'
+        proto = 'https'
+        if opts['secure'].lower() == 'no':
+            proto = 'http'
+        url = '%s://%s/%s/saml2' % (proto, opts['hostname'], opts['instance'])
         meta = metadata.Metadata(metadata.IDP_ROLE)
         meta.set_entity_id(url + '/metadata')
         meta.add_certs(cert, cert)
         meta.add_service(metadata.SAML2_SERVICE_MAP['sso-post'],
         meta = metadata.Metadata(metadata.IDP_ROLE)
         meta.set_entity_id(url + '/metadata')
         meta.add_certs(cert, cert)
         meta.add_service(metadata.SAML2_SERVICE_MAP['sso-post'],
-                         url + 'SSO/POST')
+                         url + '/SSO/POST')
         meta.add_service(metadata.SAML2_SERVICE_MAP['sso-redirect'],
         meta.add_service(metadata.SAML2_SERVICE_MAP['sso-redirect'],
-                         url + 'SSO/Redirect')
+                         url + '/SSO/Redirect')
 
         meta.add_allowed_name_format(
             lasso.SAML2_NAME_IDENTIFIER_FORMAT_TRANSIENT)
 
         meta.add_allowed_name_format(
             lasso.SAML2_NAME_IDENTIFIER_FORMAT_TRANSIENT)