def parseAllProviders(self):

        registeredProviders = {}
        print "Passport. parseAllProviders. Adding providers"
        passportDN = CdiUtil.bean(
            ConfigurationFactory).getPersistenceConfiguration(
            ).getConfiguration().getString("oxpassport_ConfigurationEntryDN")
        entryManager = CdiUtil.bean(
            AppInitializer).createPersistenceEntryManager()

        config = LdapOxPassportConfiguration()
        config = entryManager.find(config.getClass(),
                                   passportDN).getPassportConfiguration()
        config = config.getProviders() if config != None else config

        if config != None and len(config) > 0:
            for prvdetails in config:
                if prvdetails.isEnabled():
                    registeredProviders[prvdetails.getId()] = {
                        "emailLinkingSafe": prvdetails.isEmailLinkingSafe(),
                        "requestForEmail": prvdetails.isRequestForEmail(),
                        "logo_img": prvdetails.getLogoImg(),
                        "displayName": prvdetails.getDisplayName(),
                        "type": prvdetails.getType()
                    }

        return registeredProviders
Beispiel #2
0
    def parseProviderConfigs(self):

        print "Casa. parseProviderConfigs. Adding external providers"
        registeredProviders = {}
        preSelParams = self.getPreselectionIDPParams()

        try:
            passportDN = CdiUtil.bean(ConfigurationFactory).getPersistenceConfiguration().getConfiguration().getString("oxpassport_ConfigurationEntryDN")
            entryManager = CdiUtil.bean(AppInitializer).createPersistenceEntryManager()

            config = LdapOxPassportConfiguration()
            config = entryManager.find(config.getClass(), passportDN).getPassportConfiguration()
            config = config.getProviders() if config != None else config

            if config != None and len(config) > 0:      
                for prvdetails in config:
                    if prvdetails.isEnabled():
                        isSaml = prvdetails.getType() == "saml"

                        if (preSelParams["saml"] != None and isSaml) or (preSelParams["social"] != None and not isSaml):
                            registeredProviders[prvdetails.getId()] = {     
                                "logo_img": prvdetails.getLogoImg()
                                "displayName": prvdetails.getDisplayName(),
                                "saml": isSaml
                            }
        except:
            print "Casa. parseProviderConfigs. An error occurred while building the list of supported authentication providers", sys.exc_info()[1]

        print "Casa. parseProviderConfigs. Resulting list %s" % registeredProviders
        self.preSelParams = preSelParams

        return registeredProviders
    def parseAllProviders(self):

        registeredProviders = {}
        print "Passport-social. parseAllProviders. Adding providers"
        entryManager = CdiUtil.bean(PersistenceEntryManager)
        
        config = LdapOxPassportConfiguration()
        config = entryManager.find(config.getClass(), self.passportDN).getPassportConfiguration()
        config = config.getProviders() if config != None else config

        if config != None and len(config) > 0:
            for prvdetails in config:
                if prvdetails.isEnabled():
                    registeredProviders[prvdetails.getId()] = {
                        "emailLinkingSafe": prvdetails.isEmailLinkingSafe(),
                        "requestForEmail" : prvdetails.isRequestForEmail(),
                        "logo_img": prvdetails.getLogoImg(),
                        "displayName": prvdetails.getDisplayName(),
                        "type": prvdetails.getType(),
                        "issuer": prvdetails.getOptions().get("issuer")
                    }

        return registeredProviders
    def parseAllProviders(self):

        registeredProviders = {}
        print "Passport. parseAllProviders. Adding providers"
        passportDN = CdiUtil.bean(ConfigurationFactory).getPersistenceConfiguration().getConfiguration().getString("oxpassport_ConfigurationEntryDN")
        entryManager = CdiUtil.bean(AppInitializer).createPersistenceEntryManager()
        
        config = LdapOxPassportConfiguration()
        config = entryManager.find(config.getClass(), passportDN).getPassportConfiguration()
        config = config.getProviders() if config != None else config
            
        if config != None and len(config) > 0:      
            for prvdetails in config:
                if prvdetails.isEnabled():              
                    registeredProviders[prvdetails.getId()] = {     
                        "emailLinkingSafe": prvdetails.isEmailLinkingSafe(), 
                        "requestForEmail" : prvdetails.isRequestForEmail(),
                        "logo_img": prvdetails.getLogoImg(),
                        "displayName": prvdetails.getDisplayName(),
                        "type": prvdetails.getType()
                    }
        
        return registeredProviders