def __call__(self, userid, **kwargs): result = UserInfoLDAP.__call__(self, userid, None, False) if self.verify_attr in result: for field in result[self.verify_attr]: if field in self.verify_attr_valid: return True logger.warning(userid + "tries to use the service with the values " + result) return False
def __init__(self, verify_attr=None, verify_attr_valid=None, **kwargs): UserInfoLDAP.__init__(self, **kwargs) self.verify_attr = verify_attr self.verify_attr_valid = verify_attr_valid
except Exception, err: LOGGER.error("Key setup failed: %s" % err) OAS.key_setup("static", sig={"format": "jwk", "alg": "rsa"}) else: new_name = "static/jwks.json" f = open(new_name, "w") f.write(json.dumps(jwks)) f.close() OAS.jwks_uri.append("%s%s" % (OAS.baseurl, new_name)) for b in OAS.keyjar[""]: LOGGER.info("OC3 server keys: %s" % b) if config.USERINFO == "LDAP": from oic.utils.userinfo.ldap_info import UserInfoLDAP OAS.userinfo = UserInfoLDAP(**config.LDAP) elif config.USERINFO == "SIMPLE": OAS.userinfo = UserInfo(config.USERDB) elif config.USERINFO == "DISTRIBUTED": from oic.utils.userinfo.distaggr import DistributedAggregatedUserInfo OAS.userinfo = DistributedAggregatedUserInfo(config.USERDB, OAS, config.CLIENT_INFO) LOGGER.debug("URLS: '%s" % (URLS, )) # Add the claims providers keys SRV = wsgiserver.CherryPyWSGIServer(('0.0.0.0', args.port), application) SRV.ssl_adapter = ssl_pyopenssl.pyOpenSSLAdapter(config.SERVER_CERT, config.SERVER_KEY, config.CERT_CHAIN)