def verify(): msg = "Configuration Error: " try: int(wikid_port) except ValueError: return msg + " 'Port' must be an integer." if not os.path.exists(pkey): return msg + " Cannot access to '%s' No such file." % pkey if not os.path.exists(caCert): return msg + " Cannot access to '%s' No such file." % caCert try: pywClient(host=wikid_host, port=wikid_port, pkey=pkey, passPhrase=passPhrase, caCert=caCert) except: return msg + " WIKID Client error. Check certificates."
def authenticateCredentials(self, credentials): """ See IAuthenticationPlugin. o We expect the credentials to be those returned by ILoginPasswordExtractionPlugin. """ login = credentials.get( 'login' ) password = credentials.get( 'password' ) domaincode = '127000000001' host = '127.0.0.1' port = 8388 caCert = '/opt/Plone-3.0.6/zinstance/Products/WiKIDAuthPlugin/WiKID-ca.pem' pkey = '/opt/Plone-3.0.6/zinstance/Products/WiKIDAuthPlugin/laptop.p12' passPhrase = 'passphrase' w = pywClient(host=host, port=port, pkey=pkey, passPhrase=passPhrase, caCert=caCert) if login is None or password is None: return None res = w.checkCredentials(login, domaincode, password) if res == True: return login, login else: print None
def authenticateCredentials(self, credentials): """ See IAuthenticationPlugin. o We expect the credentials to be those returned by ILoginPasswordExtractionPlugin. """ login = credentials.get('login') password = credentials.get('password') try: w = pywClient(host=self.wikid_host, port=self.wikid_port, pkey=self.pkey, passPhrase=self.passPhrase, caCert=self.caCert) except: return None if login is None or password is None: return None res = w.checkCredentials(login, self.domaincode, password) if res is True: return login, login else: print None
host = '10.100.0.10' port = 8388 pkey = 'support.p12' passPhrase = 'wikidone' correct = 'n' while correct != 'y': host = raw_input('Please enter host: ') port = int(raw_input('Please enter port: ')) pkey = raw_input('Please enter the p12 cert filename: ') passPhrase = raw_input('Please enter the passPhrase: ') caCert = raw_input('Please enter the CACertStore: ') correct = raw_input('Is this correct[y/n]: ') w = pywClient(host=host,port=port,pkey=pkey,passPhrase=passPhrase,caCert=caCert) print 'Connection created...' # User Registration Section print 'User Registration' correct = 'n' while correct != 'y': user = raw_input('Please enter user: '******'Please enter registration code: ') domaincode = '127000000001' temp = raw_input('Please enter server code[127000000001]: ') if temp != '': domaincode = temp print 'Regsitering user with this information' print 'user:'******'regcode:', regcode